0
$\begingroup$

Rosanswers logo

Hi,

I am trying to install pcl_ros from source on a raspberry pi running groovy. I get this undefined reference when it tries to link bag_to_pcd

[  5%] Built target pcl_ros_tf
Linking CXX executable /opt/ros/groovy/ros_catkin_ws/devel_isolated/pcl_ros/lib/pcl_ros/bag_to_pcd
CMakeFiles/bag_to_pcd.dir/tools/bag_to_pcd.cpp.o: In function `pcl::PCDWriter::write(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, sensor_msgs::PointCloud2_<std::allocator<void> > const&, Eigen::Matrix<float, 4, 1, 0, 4, 1> const&, Eigen::Quaternion<float, 0> const&, bool)':
bag_to_pcd.cpp:(.text._ZN3pcl9PCDWriter5writeERKSsRKN11sensor_msgs12PointCloud2_ISaIvEEERKN5Eigen6MatrixIfLi4ELi1ELi0ELi4ELi1EEERKNS9_10QuaternionIfLi0EEEb[pcl::PCDWriter::write(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, sensor_msgs::PointCloud2_<std::allocator<void> > const&, Eigen::Matrix<float, 4, 1, 0, 4, 1> const&, Eigen::Quaternion<float, 0> const&, bool)]+0x40): undefined reference to `pcl::PCDWriter::writeBinary(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, sensor_msgs::PointCloud2_<std::allocator<void> > const&, Eigen::Matrix<float, 4, 1, 0, 4, 1> const&, Eigen::Quaternion<float, 0> const&)'
bag_to_pcd.cpp:(.text._ZN3pcl9PCDWriter5writeERKSsRKN11sensor_msgs12PointCloud2_ISaIvEEERKN5Eigen6MatrixIfLi4ELi1ELi0ELi4ELi1EEERKNS9_10QuaternionIfLi0EEEb[pcl::PCDWriter::write(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, sensor_msgs::PointCloud2_<std::allocator<void> > const&, Eigen::Matrix<float, 4, 1, 0, 4, 1> const&, Eigen::Quaternion<float, 0> const&, bool)]+0x6c): undefined reference to `pcl::PCDWriter::writeASCII(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, sensor_msgs::PointCloud2_<std::allocator<void> > const&, Eigen::Matrix<float, 4, 1, 0, 4, 1> const&, Eigen::Quaternion<float, 0> const&, int)'
collect2: ld returned 1 exit status
make[2]: *** [/opt/ros/groovy/ros_catkin_ws/devel_isolated/pcl_ros/lib/pcl_ros/bag_to_pcd] Error 1
make[1]: *** [CMakeFiles/bag_to_pcd.dir/all] Error 2
make: *** [all] Error 2
<== Failed to process package 'pcl_ros': 
  Command '['/opt/ros/groovy/ros_catkin_ws/build_isolated/nodelet_topic_tools/catkin_generated/env_cached.sh', 'make', '-j1']' returned non-zero exit status 2
Command failed, exiting.

according to the PCL forum an undefined reference to pcl::PCDWriter::write means that I did not link against libpcl_io.so

I checked the CMakeLists and it does link against it, so I do not know what the problem is. It would be great if anyone can help


Originally posted by kalectro on ROS Answers with karma: 1554 on 2013-01-31

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

So the problem seems to be that I compiled PCL as an external library which is unfortunately different from PCL provided by ROS.


Originally posted by kalectro with karma: 1554 on 2013-02-07

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by obsti on 2013-03-26:
So what did you do to fix it?

Comment by kalectro on 2013-03-26:
if you install ROS from source it comes with its own PCL which should work. Installing PCL as an external dependency can also work. Just make sure to compile with USE_ROS = 1

Comment by obsti on 2013-03-26:
Where and how do I need to set USE_ROS=1?

Comment by kalectro on 2013-03-26:
Which version do you want to compile? Is 1.6.0 ok for you? Then you can use the PCL provided by ROS and you can just catkin_make_isolated it without any change. If 1.6.0 is not acceptable, use cmake -DUSE_ROS=1 .

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.