0
$\begingroup$

Rosanswers logo

Ubuntu12.04 fuerte

When I just add this one line in the code, I am getting the errors given below.

pcl::NormalEstimation<pcl::PointXYZ, pcl::Normal> ne;

Full code

void cloud_cb (const sensor_msgs::PointCloud2ConstPtr& cloud) {

sensor_msgs::PointCloud2 cloud_filtered;

         // estimate normals
         pcl::PointCloud<pcl::Normal>::Ptr normals (new pcl::PointCloud<pcl::Normal>);

              pcl::NormalEstimation<pcl::PointXYZ, pcl::Normal> ne;

// Publish the data pub.publish (cloud_filtered);

}

Error:

CMakeFiles/temp3.dir/src/temp3.cpp.o: In function pcl::search::OrganizedNeighbor<pcl::PointXYZ>::setInputCloud(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZ> const> const&)': temp3.cpp:(.text._ZN3pcl6search17OrganizedNeighborINS_8PointXYZEE13setInputCloudERKN5boost10shared_ptrIKNS_10PointCloudIS2_EEEE[pcl::search::OrganizedNeighbor<pcl::PointXYZ>::setInputCloud(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZ> const> const&)]+0x88): undefined reference to pcl::search::OrganizedNeighborpcl::PointXYZ::estimateFocalLengthFromInputCloud(pcl::PointCloudpcl::PointXYZ const&)' temp3.cpp:(.text._ZN3pcl6search17OrganizedNeighborINS_8PointXYZEE13setInputCloudERKN5boost10shared_ptrIKNS_10PointCloudIS2_EEEE[pcl::search::OrganizedNeighborpcl::PointXYZ::setInputCloud(boost::shared_ptrpcl::PointCloud<pcl::PointXYZ const> const&)]+0xa2): undefined reference to pcl::search::OrganizedNeighbor<pcl::PointXYZ>::generateRadiusLookupTable(unsigned int, unsigned int)' CMakeFiles/temp3.dir/src/temp3.cpp.o: In function pcl::search::OrganizedNeighborpcl::PointXYZ::setInputCloud(boost::shared_ptrpcl::PointCloud<pcl::PointXYZ const> const&, boost::shared_ptr<std::vector<int, std::allocator > const> const&)': temp3.cpp:(.text._ZN3pcl6search17OrganizedNeighborINS_8PointXYZEE13setInputCloudERKN5boost10shared_ptrIKNS_10PointCloudIS2_EEEERKNS5_IKSt6vectorIiSaIiEEEE[pcl::search::OrganizedNeighborpcl::PointXYZ::setInputCloud(boost::shared_ptrpcl::PointCloud<pcl::PointXYZ const> const&, boost::shared_ptr<std::vector<int, std::allocator > const> const&)]+0xd8): undefined reference to pcl::search::OrganizedNeighbor<pcl::PointXYZ>::estimateFocalLengthFromInputCloud(pcl::PointCloud<pcl::PointXYZ> const&)' temp3.cpp:(.text._ZN3pcl6search17OrganizedNeighborINS_8PointXYZEE13setInputCloudERKN5boost10shared_ptrIKNS_10PointCloudIS2_EEEERKNS5_IKSt6vectorIiSaIiEEEE[pcl::search::OrganizedNeighbor<pcl::PointXYZ>::setInputCloud(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZ> const> const&, boost::shared_ptr<std::vector<int, std::allocator<int> > const> const&)]+0xf2): undefined reference to pcl::search::OrganizedNeighborpcl::PointXYZ::generateRadiusLookupTable(unsigned int, unsigned int)' CMakeFiles/temp3.dir/src/temp3.cpp.o:(.rodata._ZTVN3pcl6search17OrganizedNeighborINS_8PointXYZEEE[vtable for pcl::search::OrganizedNeighborpcl::PointXYZ]+0x24): undefined reference to pcl::search::OrganizedNeighbor<pcl::PointXYZ>::nearestKSearch(pcl::PointCloud<pcl::PointXYZ> const&, int, int, std::vector<int, std::allocator<int> >&, std::vector<float, std::allocator<float> >&)' CMakeFiles/temp3.dir/src/temp3.cpp.o:(.rodata._ZTVN3pcl6search17OrganizedNeighborINS_8PointXYZEEE[vtable for pcl::search::OrganizedNeighbor<pcl::PointXYZ>]+0x28): undefined reference to pcl::search::OrganizedNeighborpcl::PointXYZ::nearestKSearch(int, int, std::vector<int, std::allocator >&, std::vector<float, std::allocator >&)' CMakeFiles/temp3.dir/src/temp3.cpp.o:(.rodata._ZTVN3pcl6search17OrganizedNeighborINS_8PointXYZEEE[vtable for pcl::search::OrganizedNeighborpcl::PointXYZ]+0x30): undefined reference to pcl::search::OrganizedNeighbor<pcl::PointXYZ>::radiusSearch(pcl::PointXYZ const&, double, std::vector<int, std::allocator<int> >&, std::vector<float, std::allocator<float> >&, int) const' CMakeFiles/temp3.dir/src/temp3.cpp.o:(.rodata._ZTVN3pcl6search17OrganizedNeighborINS_8PointXYZEEE[vtable for pcl::search::OrganizedNeighbor<pcl::PointXYZ>]+0x38): undefined reference to pcl::search::OrganizedNeighborpcl::PointXYZ::radiusSearch(int, double, std::vector<int, std::allocator >&, std::vector<float, std::allocator >&, int) const' collect2: ld returned 1 exit status make[3]: *** [../bin/temp3] Error 1


Originally posted by sai on ROS Answers with karma: 1935 on 2013-08-24

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I'm having a very similar issue, which I posted to the PCL pages here: http://www.pcl-users.org/undefined-reference-to-pcl-PCLBase-when-linking-with-catkin-td4029311.html#a4029329

I tried adding the namespace line, but I got a compilation error:

/home/abouchard/catkin_ws/src/find_object/src/find_object.cpp:46:17: error: ‘pcl17’ is not a namespace-name

My initial hunch was that I had incorrectly installed PCL 1.7 over 1.6, and indeed they had installed to different places and it seemed to be a crap shoot which files were being used. However, at this point I've completely removed all 1.6 stuff and it's still hitting linker problems.

Since I'm able to build the correspondence_grouping tutorial independent of ROS, I'm starting to think that the issue might be with catkin, and was researching other answers here to make sure that it's not already addressed when I ran across this.


Originally posted by teddybouch with karma: 320 on 2013-08-29

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

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