ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

linker error compiling pcl_ros

asked 2012-08-15 03:40:56 -0600

aldo85ita gravatar image

updated 2012-08-15 17:02:53 -0600

joq gravatar image

Hi everybody, I downloaded and I've tried to compile pcl_ros, but I got the following errors:

svn co
roscd pcl_ros
rosmake --rosdep-install

/opt/ros/electric/stacks/common_msgs/sensor_msgs/msg_gen/cpp/include/sensor_msgs/PointField.h:98:35: warning: unused parameter ‘seq’ [-Wunused-parameter] Linking CXX executable ../../bin/pcl_viewer CMakeFiles/pcl_viewer.dir/pcd_viewer.cpp.o: In function pp_callback(pcl::visualization::PointPickingEvent const&, void*)': pcd_viewer.cpp:(.text+0x1d85): undefined reference topcl::visualization::PCLPlotter::addFeatureHistogram(sensor_msgs::PointCloud2_<std::allocator<void> > const&, std::basic_string<char, std::char_traits<char="">, std::allocator<char> > const&, int, std::basic_string<char, std::char_traits<char="">, std::allocator<char> > const&, int, int)' pcd_viewer.cpp:(.text+0x21d0): undefined reference to pcl::visualization::PCLPlotter::spinOnce(int)' CMakeFiles/pcl_viewer.dir/pcd_viewer.cpp.o: In functionmain': pcd_viewer.cpp:(.text.startup+0x2fc7): undefined reference to pcl::visualization::PCLPlotter::addFeatureHistogram(sensor_msgs::PointCloud2_<std::allocator<void> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, int)' pcd_viewer.cpp:(.text.startup+0x4fdd): undefined reference topcl::visualization::PCLPlotter::PCLPlotter(char const)' pcd_viewer.cpp:(.text.startup+0x59a9): undefined reference to pcl::visualization::PCLPlotter::spin()' CMakeFiles/pcl_viewer.dir/pcd_viewer.cpp.o: In function_GLOBAL__sub_I__Z16isValidFieldNameRKSs': pcd_viewer.cpp:(.text.startup+0x67d6): undefined reference to pcl::visualization::PCLPlotter::PCLPlotter(char const*)' collect2: ld returned 1 exit status make[3]: *** [bin/pcl_viewer] Error 1 make[3]: Leaving directory/home/aldo/Projects/4thRC/BergamoComponents/perception_pcl_electric_unstable/pcl/build/pcl_trunk/build' make[2]: ** [visualization/tools/CMakeFiles/pcl_viewer.dir/all] Error 2 make[2]: Leaving directory /home/aldo/Projects/4thRC/BergamoComponents/perception_pcl_electric_unstable/pcl/build/pcl_trunk/build' make[1]: *** [all] Error 2 make[1]: Leaving directory/home/aldo/Projects/4thRC/BergamoComponents/perception_pcl_electric_unstable/pcl/build/pcl_trunk/build' -------------------------------------------------------------------------------} [ rosmake ] Output from build of package pcl written to: [ 1 Active 40/42 Complete ] [ rosmake ] /home/aldo/.ros/rosmake/rosmake_output-20120815-102529/pcl/build_output.log [rosmake-0] Finished <<< pcl [FAIL] [ 5726.81 seconds ]
[ rosmake ] Halting due to failure in package pcl. [ rosmake ] Waiting for other threads to complete.
[ rosmake ] Results:
[ rosmake ] Built 41 packages with 1 failures.
[ rosmake ] Summary output to directory

any idea? Note: I'm using Ubuntu 11.10 with ROS electric and stays in ./pcl/build/pcl_trunk/build/lib/ Regards

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2012-09-30 04:57:25 -0600

DamienJadeDuff gravatar image

Hi there

I have just compiled a recent version of PCL this way (untested, at your own risk!) by disabling some things. The things that I disabled may be needed by you, though.

Actually, my one built against revision 6849 of pcl, but what worked there might work here (yours is one of the problems that came up).

Note that this answer applies to Ubuntu 11.10.


  • Start the build. When pcl build fails, go to perception_pcl_unstable/pcl/build/pcl_trunk/visualization/tools/CMakeLists.txt and comment out the lines regarding pcd_viewer (you will not get the pcd_viewer). This should stop the error that you are having, which is because it tries to build it even though the VTK version does not supply everything it needs.

  • Also, you will probably need to disable some modules. You do this by going into perception_pcl_unstable/pcl/build/pcl_trunk/build, running ccmake .. (you might have to install cmake-gui-curses) and disabling the modules. I disabled apps, modeller, tools, surface, and examples modules, but you may have better luck with different ones. I probably didn't need to disable them all.

    • Depending on which modules you disable, you may have to remove them from the linker flags exported by perception_pcl_unstable/pcl/manifest.xml - for example, I removed -lpcl_surface

Hope this helps someone.

edit flag offensive delete link more

Question Tools


Asked: 2012-08-15 03:40:56 -0600

Seen: 981 times

Last updated: Sep 30 '12