Here are some things you can try. Use nm on the library to verify the needed symbol is in the lib. If so, next verify the exact, mangled name matches in the app object file and the lib. See the nm options for getting mangled and unmangled names.
If they match, verify the compile is picking up the right files. GCC has an option that helps, but I prefer to go straight for strace. Look for two things - the exact paths being read for the lib and app file, and the order the are read. If the lib is read after the object, there is a small chance that is your problem. Looking at the compile line, I doubt that is, but it is in the realm of possibilities. Sent from my iPhone > On Mar 9, 2014, at 6:45 AM, "justinj656 [via ActiveMQ]" > <[email protected]> wrote: > > Hi, > there are some link errors when I use g++ to build my codes. > To begin with, I build and install the activemq-cpp 3.8.2 following the > readme.txt with default settings and everything is ok. In addtion I run "make > test" and "./activemq-test-integration", all the tests are passed. Then I > begin to build my own cpp file with the command below: > g++ -I/usr/local/include/activemq-cpp-3.8.2/ -I/usr/local/apr/include/apr-1 > -L/usr/local/lib -lactivemq-cpp -o a.o ~/Desktop/Test.cpp > my code is correctly compiled but with a lot of "undefined reference to" > errors, like: > Simple.cpp:(.text+0x1a): undefined reference to > `activemq::library::ActiveMQCPP::initializeLibrary()' > Simple.cpp:(.text+0x166): undefined reference to > `activemq::library:::shutdownLibrary()' > I am sure my dictories are right, but the linker just can not find the > corresponding functions. And I really have no idea. Am I missing something? > Please give me a hand. > ps:my OS is Ubuntu 12.04.4 LTS 64bit version > > > If you reply to this email, your message will be added to the discussion > below: > http://activemq.2283324.n4.nabble.com/undefined-reference-to-errors-tp4678665.html > To start a new topic under ActiveMQ - User, email > [email protected] > To unsubscribe from ActiveMQ - User, click here. > NAML -- View this message in context: http://activemq.2283324.n4.nabble.com/undefined-reference-to-errors-tp4678665p4678668.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.
