Skip to main content



      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 11:44 Go to next message
Eclipse UserFriend
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 11:48 Go to previous messageGo to next message
Eclipse UserFriend
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 11:58 Go to previous messageGo to next message
Eclipse UserFriend
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 11:59] by Moderator

Re: Setting up Eclipse to C++ development using MQ WebSphere [message #760535 is a reply to message #760524] Fri, 02 December 2011 12:58 Go to previous messageGo to next message
Eclipse UserFriend
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 13:07 Go to previous message
Eclipse UserFriend
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: Wed Jul 30 15:31:59 EDT 2025

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

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

Back to the top