Error while compiling cpp file on ros
My code is composed by three files which are class file, function file and main file. lblobject is a class object and printg is function in the class. When I use the function "lblobject.printg()" in the main file, then error occur as shown below: /usr/bin/ld: /home/gupta/catkinws2/installisolated/lib/uwsimbullet/libBulletDynamics.a(btDiscreteDynamicsWorld.o):
undefined reference to symbol 'btSimulationIslandManager::btSimulationIslandManager()'
/usr/bin/ld: note: 'btSimulationIslandManager::btSimulationIslandManager()' is defined in DSO /home/gupta/catkinws2
/install_isolated/lib/libosgbInteraction.so so try adding it to the linker command line
/home/gupta/catkinws2/install_isolated/lib/libosgbInteraction.so: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
make[2]: *** [/home/gupta/catkinws2/devel_isolated/uwsim/lib/uwsim/mainLocal] Error 1
make[1]: *** [CMakeFiles/mainLocal.dir/all] Error 2
make: *** [all] Error 2
<== Failed to process package 'uwsim':
Command '/home/gupta/catkinws2/install_isolated/env.sh make -j8 -l8' returned non-zero exit status 2
However, when I remove "lblobject.printg()" in the main file, then there is no error. Besides, when I use the data member of the class by utilizing "lbl_object.g=10;" in the main file, there is no error.
Asked by ZYS on 2016-05-31 15:08:46 UTC
Comments