Linking errors with pcl and ROS [closed]
Hello,
I am trying to build the example in this tutorial: http://wiki.ros.org/pcl/Tutorials
In the end, I have got the error listed bellow. It seems that I have to configure some parameters in CMakeLists.txt, but I am not sure.
Also, to compile I have put the following sentences in CMakeLists.txt (to find the pcl include directories):
include_directories(/opt/ros/groovy/include/pcl-1.6/pcl)
include_directories(/opt/ros/groovy/include/pcl-1.6)
include_directories(/usr/include/eigen3)
Anyone can help me?
[ 0%] [ 0%] [ 0%] Built target std_msgs_generate_messages_py
Built target std_msgs_generate_messages_cpp
Built target std_msgs_generate_messages_lisp
[ 13%] Built target beginner_tutorials_generate_messages_cpp
[ 46%] Built target beginner_tutorials_generate_messages_lisp
[ 53%] Built target beginner_tutorials_generate_messages_py
[ 53%] Built target beginner_tutorials_gencpp
[ 66%] [ 66%] Built target listener
Built target controller
[ 73%] Built target recog
Linking CXX executable /informatik2/wtm/home/borghetti/Development/ROSTest/catkin_ws/devel/lib/beginner_tutorials/surface
[ 80%] Built target add_two_ints_client
[ 93%] [ 93%] Built target talker
Built target add_two_ints_server
[ 93%] Built target beginner_tutorials_generate_messages
CMakeFiles/surface.dir/src/surface.cpp.o: In function cloud_cb(boost::shared_ptr<sensor_msgs::PointCloud2_<std::allocator<void> > const> const&)':
surface.cpp:(.text+0x46): undefined reference to
pcl::PCLBase<sensor_msgs::pointcloud2_<std::allocator<void> > >::setInputCloud(boost::shared_ptr<sensor_msgs::pointcloud2_<std::allocator<void> > const> const&)'
surface.cpp:(.text+0x86): undefined reference to pcl::Filter<sensor_msgs::PointCloud2_<std::allocator<void> > >::filter(sensor_msgs::PointCloud2_<std::allocator<void> >&)'
CMakeFiles/surface.dir/src/surface.cpp.o: In function
pcl::VoxelGrid<sensor_msgs::pointcloud2_<std::allocator<void> > >::VoxelGrid()':
surface.cpp:(.text._ZN3pcl9VoxelGridIN11sensor_msgs12PointCloud2_ISaIvEEEEC2Ev[_ZN3pcl9VoxelGridIN11sensor_msgs12PointCloud2_ISaIvEEEEC5Ev]+0x25): undefined reference to vtable for pcl::VoxelGrid<sensor_msgs::PointCloud2_<std::allocator<void> > >'
CMakeFiles/surface.dir/src/surface.cpp.o: In function
pcl::VoxelGrid<sensor_msgs::pointcloud2_<std::allocator<void> > >::~VoxelGrid()':
surface.cpp:(.text._ZN3pcl9VoxelGridIN11sensor_msgs12PointCloud2_ISaIvEEEED2Ev[_ZN3pcl9VoxelGridIN11sensor_msgs12PointCloud2_ISaIvEEEED5Ev]+0x14): undefined reference to `vtable for pcl::VoxelGrid<sensor_msgs::pointcloud2_<std::allocator<void> > >'
collect2: ld returned 1 exit status
make[2]: * Error 1
make[1]: [beginner_tutorials/CMakeFiles/surface.dir/all] Error 2
make: ** [all] Error 2
Invoking "make" failed