Linking errors with pcl and ROS
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 stdmsgsgeneratemessagespy
Built target stdmsgsgeneratemessagescpp
Built target stdmsgsgeneratemessageslisp
[ 13%] Built target beginnertutorialsgeneratemessagescpp
[ 46%] Built target beginnertutorialsgeneratemessageslisp
[ 53%] Built target beginnertutorialsgeneratemessagespy
[ 53%] Built target beginnertutorialsgencpp
[ 66%] [ 66%] Built target listener
Built target controller
[ 73%] Built target recog
Linking CXX executable /informatik2/wtm/home/borghetti/Development/ROSTest/catkinws/devel/lib/beginnertutorials/surface
[ 80%] Built target addtwointsclient
[ 93%] [ 93%] Built target talker
Built target addtwointsserver
[ 93%] Built target beginnertutorialsgeneratemessages
CMakeFiles/surface.dir/src/surface.cpp.o: In function `cloudcb(boost::sharedptr<sensormsgs::PointCloud2std::allocator<void > const> const&)':
surface.cpp:(.text+0x46): undefined reference to `pcl::PCLBase<sensormsgs::PointCloud2std::allocator<void > >::setInputCloud(boost::sharedptrpcl::Filter<sensor_msgs::PointCloud2_<std::allocator<void> > >::filter(sensor_msgs::PointCloud2_<std::allocator<void> >&)'
CMakeFiles/surface.dir/src/surface.cpp.o: In function
pcl::VoxelGridvtable for pcl::VoxelGrid<sensor_msgs::PointCloud2_<std::allocator<void> > >'
CMakeFiles/surface.dir/src/surface.cpp.o: In function
pcl::VoxelGrid
Asked by borghetti on 2014-03-07 03:46:25 UTC
Answers
Hello,
I have forgotten to include the following lines (as stated in tutorial) in CMakeLists.txt
find_package(PCL 1.2 REQUIRED)
include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})
target_link_libraries (APPLICATION ${PCL_LIBRARIES})
After this, the building problem was solved. Thanks!
Asked by borghetti on 2014-03-07 04:40:48 UTC
Comments