Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Setting up Eclipse to C++ development using MQ WebSphere
Setting up Eclipse to C++ development using MQ WebSphere [message #760519] Fri, 02 December 2011 16:44 Go to next message
Michael Beatty is currently offline Michael BeattyFriend
Messages: 43
Registered: November 2011
Member
I'm having trouble compiling my MQ sample application through eclipse. I'm quite certain I just need to property configure eclipise to read the correct libraries and paths, but I'm not really sure how to do so.

So far, through Properties > C++ General > Libraries and Paths:
***************
Includes Tab > C++
/opt/mqm/inc
/opt/mqm/lib

Libraries Tab
/opt/mqm/lib/libmqm.so

Libraries Path Tab
/opt/mqm/inc
/opt/mqm/lib
/usr/lib

*******************

When I compile through eclipse, I get the following output with one error:
**** Build of configuration Debug for project TestC++ ****

make all
Building target: TestC++
Invoking: Cross G++ Linker
g++ -L/opt/mqm/lib -L/opt/mqm/inc -L/usr/lib -o "TestC++" ./cppTest.o -l/opt/mqm/lib/libmqm.so
/client_root/usr/bin/../lib/gcc/i586-suse-linux/4.3/../../../../i586-suse-linux/bin/ld: cannot find -l/opt/mqm/lib/libmqm.so
collect2: ld returned 1 exit status
make: *** [TestC++] Error 1

**** Build Finished ****

Why is the make unable to find /opt/mqm/libmqm.so? I thought I included it?


Re: Setting up Eclipse to C++ development using MQ WebSphere [message #760520 is a reply to message #760519] Fri, 02 December 2011 16:48 Go to previous messageGo to next message
Doug Schaefer is currently offline Doug SchaeferFriend
Messages: 135
Registered: July 2009
Senior Member
You should be specifying 'mqm' in the libraries setting, not the full path to the .so. The linker will find it for you thanks to the -L argument. You should see -lmqm on the command line if things are set up correctly.
Re: Setting up Eclipse to C++ development using MQ WebSphere [message #760524 is a reply to message #760520] Fri, 02 December 2011 16:58 Go to previous messageGo to next message
Michael Beatty is currently offline Michael BeattyFriend
Messages: 43
Registered: November 2011
Member
I changed my "Libraries" to /opt/mqm

Rebuilt, no change. I get the following output


make all
Building target: TestC++
Invoking: Cross G++ Linker
g++ -L/opt/mqm/lib -L/opt/mqm/inc -L/usr/lib -o "TestC++" ./cppTest.o -l/opt/mqm
/client_root/usr/bin/../lib/gcc/i586-suse-linux/4.3/../../../../i586-suse-linux/bin/ld: cannot find -l/opt/mqm
collect2: ld returned 1 exit status
make: *** [TestC++] Error 1

**** Build Finished ****

I do see the -l/opt/mqm in the output... but then it says it cannot find it?

[Updated on: Fri, 02 December 2011 16:59]

Report message to a moderator

Re: Setting up Eclipse to C++ development using MQ WebSphere [message #760535 is a reply to message #760524] Fri, 02 December 2011 17:58 Go to previous messageGo to next message
Michael Beatty is currently offline Michael BeattyFriend
Messages: 43
Registered: November 2011
Member
Going off of the IBM MQ documentation, if I compile from the shell using:
g++ -m32 -fsigned-char -o delme test.cpp -I/opt/mqm/inc
-L/opt/mqm/lib -Wl,-rpath=/opt/mqm/lib -L/opt/mqm/lib
-Wl,-rpath=/opt/mqm/lib -Wl,-rpath=/usr/lib -limqs23gl -limqb23gl -lmqm


The application compiles just fine.

I would have to assume that the -rpath parameter is telling the compiler where to find the libraries.

But how do I get eclipse to do this for me automatically? The reason I want to work in eclipse is to simplify things, if i have to manually make my own make files, this kind of defeats the purpose.
Re: Setting up Eclipse to C++ development using MQ WebSphere [message #760536 is a reply to message #760535] Fri, 02 December 2011 18:07 Go to previous message
Michael Beatty is currently offline Michael BeattyFriend
Messages: 43
Registered: November 2011
Member
Solved the problem.... Its all coming off of my misunderstanding how the eclipse paths are setup.

I had my library path set to /opt/mqm/lib.... which was correct

But I had my library set to /opt/mqm/lib... which was obviously not correct.

So it was looking for /opt/mqm/lib/opt/mqm/lib.

On top of that, the mqm library was the wrong library anyway.
Previous Topic:how do I look at class variables in debug mode?
Next Topic:OpenOCD+Eclipse CDT+yagarto+zylin
Goto Forum:
  


Current Time: Thu Apr 25 14:53:26 GMT 2024

Powered by FUDForum. Page generated in 0.03787 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top