Error while compiling cpp file on ros

asked 2016-05-31 15:08:46 -0500

ZYS gravatar image

My code is composed by three files which are class file, function file and main file. lbl_object is a class object and print_g is function in the class. When I use the function "lbl_object.print_g()" in the main file, then error occur as shown below: /usr/bin/ld: /home/gupta/catkin_ws_2/install_isolated/lib/uwsim_bullet/libBulletDynamics.a(btDiscreteDynamicsWorld.o):

undefined reference to symbol 'btSimulationIslandManager::btSimulationIslandManager()'

/usr/bin/ld: note: 'btSimulationIslandManager::btSimulationIslandManager()' is defined in DSO /home/gupta/catkin_ws_2

/install_isolated/lib/libosgbInteraction.so so try adding it to the linker command line

/home/gupta/catkin_ws_2/install_isolated/lib/libosgbInteraction.so: could not read symbols: Invalid operation

collect2: ld returned 1 exit status

make[2]: * [/home/gupta/catkin_ws_2/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/catkin_ws_2/install_isolated/env.sh make -j8 -l8' returned non-zero exit status 2

However, when I remove "lbl_object.print_g()" 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.

edit retag flag offensive close merge delete