Ask Your Question

undefined reference to symbol '_ZN3ros10NodeHandle9subscribeERNS_16SubscribeOptionsE'

asked 2018-08-30 22:48:57 -0500

Camilla gravatar image

I am simply trying to compile a program in ROS. I already linked all the necessary libraries but this one I can't find. All I am getting is the following error in code blocks (also in eclipse).

Anybody know how to get rid of this error? Or even which library it require?

/usr/bin/ld:CMakeFiles/DistanceKinectDemo.dir/src/DistanceKinectDemo.cpp.o: undefined reference to symbol


/opt/ros/kinetic/lib/ error adding symbols: DSO missing from command line

collect2: error: ld returned 1 exit status

gpuvoxelgetpointcloud/CMakeFiles/DistanceKinectDemo.dir/build.make:370: recipe for target 
'/home/pcl_gpu/devel/lib/gpuvoxelgetpointcloud/DistanceKinectDemo' failed
make[2]: *** [/home/shupeng/pcl_gpu/devel/lib/gpuvoxelgetpointcloud/DistanceKinectDemo] Error 1
CMakeFiles/Makefile2:1130: recipe for target 'gpuvoxelgetpointcloud/CMakeFiles/DistanceKinectDemo.dir/all' failed
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-08-31 06:01:35 -0500

gvdhoorn gravatar image

According to c++filt, the symbol that the linker can't find is ros::NodeHandle::subscribe(ros::SubscribeOptions&).

I would expect that to be coming in with roscpp, but seeing the error message shown, something is not right.

If you can show us your CMakeLists.txt, perhaps we can see whether something is not entirely ok with it.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2018-08-30 22:48:57 -0500

Seen: 368 times

Last updated: Aug 31 '18