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

Linking errors with pcl and ROS [closed]

asked 2014-03-07 02:46:25 -0500

borghetti gravatar image

updated 2014-03-07 02:57:30 -0500

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 topcl::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 functionpcl::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 functionpcl::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

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by demmeln
close date 2014-03-07 04:02:54

1 Answer

Sort by ยป oldest newest most voted
1

answered 2014-03-07 03:40:48 -0500

borghetti gravatar image

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!

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2014-03-07 02:46:25 -0500

Seen: 2,646 times

Last updated: Mar 07 '14