There seems to be an issue with compiling ROS nodes that use pcl on Ubuntu 11.10. When I try to compile my node on 10.04 I don't have any problems. Both installations were installed from the debian packages ros-electric-desktop-full and ros-electric-perception-pcl-addons.
- Ubuntu 10.04, 32-bit, ROS Electric: Works
- Ubuntu 11.10, 32-bit, ROS Electric: Doesn't compile
My node is pretty simple, mainly just visualizing a static point cloud that I create.
In the second case, I get the following compiler error during linking.
...
Linking CXX executable ../bin/publish_primitives
/usr/bin/ld: CMakeFiles/publish_primitives.dir/src/publish_primitives.o: undefined reference to symbol 'vtkSmartPointerBase::operator=(vtkObjectBase*)'
/usr/bin/ld: note: 'vtkSmartPointerBase::operator=(vtkObjectBase*)' is defined in DSO /usr/lib/libvtkCommon.so.5.6 so try adding it to the linker command line
/usr/lib/libvtkCommon.so.5.6: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
...
I manually added the required libraries in CMakeLists.txt (below) and it fixes the compiler problem.
rosbuild_add_executable(publish_primitives src/publish_primitives.cpp)
target_link_libraries(publish_primitives libvtkCommon.so libvtkFiltering.so )
Messing with the compiler flags for pcl is beyond me, so I'll leave it to the higher ups to figure out what is going on.
Originally posted by Kyle Strabala on ROS Answers with karma: 186 on 2012-01-30
Post score: 3