Open ahmadmohdrudin opened 10 years ago
@syahirulfitri I meet the same error. Do you have any idea how to fix it out?
@syahirulfitri Hi, I get the following errors on make. Do you know how to rectify it? It would be great if you could help me out.
[ 16%] Building CXX object CMakeFiles/extractOPC.dir/src/extractObjectPointclouds.cpp.o
/home/aashikgowda/human_activity_labeling/feature_generationpcl/src/extractObjectPointclouds.cpp: In function ‘int main(int, char*)’:
/home/aashikgowda/human_activity_labeling/feature_generation_pcl/src/extractObjectPointclouds.cpp:320:68: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘std::vectorstd::basic_stringgetClusters(pcl::PointCloud<pcl::PointXYZRGBCamSL>&, std::vector<pcl::PointCloud<pcl::PointXYZRGB>, std::allocator<pcl::PointCloud<pcl::PointXYZRGB> > >&, std::vector<pcl::PointIndices, std::allocator<pcl::PointIndices> >&, bool)': /home/aashikgowda/human_activity_labeling/feature_generation_pcl/src/./pointcloudClustering.h:235: undefined reference to
pcl::search::KdTree<pcl::PointXYZRGBCamSL, pcl::KdTreeFLANN<pcl::PointXYZRGBCamSL, flann::L2_Simplepcl::search::KdTree<pcl::PointXYZRGBCamSL, pcl::KdTreeFLANN<pcl::PointXYZRGBCamSL, flann::L2_Simple<float> > >::KdTree(bool)' CMakeFiles/extractOPC.dir/src/extractObjectPointclouds.cpp.o: In function
pcl::Feature<pcl::PointXYZRGBCamSL, pcl::Normal>::Feature()':
/usr/include/pcl-1.7/pcl/features/feature.h:134: undefined reference to pcl::PCLBase<pcl::PointXYZRGBCamSL>::PCLBase()' CMakeFiles/extractOPC.dir/src/extractObjectPointclouds.cpp.o: In function
pcl::Feature<pcl::PointXYZRGBCamSL, pcl::Normal>::initCompute()':
/usr/include/pcl-1.7/pcl/features/impl/feature.hpp:95: undefined reference to pcl::PCLBase<pcl::PointXYZRGBCamSL>::initCompute()' /usr/include/pcl-1.7/pcl/features/impl/feature.hpp:123: undefined reference to
pcl::search::KdTree<pcl::PointXYZRGBCamSL, pcl::KdTreeFLANN<pcl::PointXYZRGBCamSL, flann::L2_Simplepcl::search::OrganizedNeighbor<pcl::PointXYZRGBCamSL>::OrganizedNeighbor(bool, float, unsigned int)': /usr/include/pcl-1.7/pcl/search/organized.h:95: undefined reference to
pcl::search::Searchpcl::PointXYZRGBCamSL::Search(std::string const&, bool)'
CMakeFiles/extractOPC.dir/src/extractObjectPointclouds.cpp.o:(.rodata._ZTVN3pcl6search17OrganizedNeighborINS_16PointXYZRGBCamSLEEE[_ZTVN3pcl6search17OrganizedNeighborINS_16PointXYZRGBCamSLEEE]+0x20): undefined reference to pcl::search::Search<pcl::PointXYZRGBCamSL>::getName() const' CMakeFiles/extractOPC.dir/src/extractObjectPointclouds.cpp.o:(.rodata._ZTVN3pcl6search17OrganizedNeighborINS_16PointXYZRGBCamSLEEE[_ZTVN3pcl6search17OrganizedNeighborINS_16PointXYZRGBCamSLEEE]+0x28): undefined reference to
pcl::search::Searchpcl::PointXYZRGBCamSL::setSortedResults(bool)'
CMakeFiles/extractOPC.dir/src/extractObjectPointclouds.cpp.o:(.rodata._ZTVN3pcl6search17OrganizedNeighborINS_16PointXYZRGBCamSLEEE[_ZTVN3pcl6search17OrganizedNeighborINS_16PointXYZRGBCamSLEEE]+0x30): undefined reference to pcl::search::Search<pcl::PointXYZRGBCamSL>::getSortedResults()' CMakeFiles/extractOPC.dir/src/extractObjectPointclouds.cpp.o:(.rodata._ZTVN3pcl6search17OrganizedNeighborINS_16PointXYZRGBCamSLEEE[_ZTVN3pcl6search17OrganizedNeighborINS_16PointXYZRGBCamSLEEE]+0x58): undefined reference to
pcl::search::Searchpcl::PointXYZRGBCamSL::nearestKSearch(pcl::PointCloudpcl::PointXYZRGBCamSL const&, int, int, std::vector<int, std::allocatorpcl::search::Search<pcl::PointXYZRGBCamSL>::nearestKSearch(int, int, std::vector<int, std::allocator<int> >&, std::vector<float, std::allocator<float> >&) const' CMakeFiles/extractOPC.dir/src/extractObjectPointclouds.cpp.o:(.rodata._ZTVN3pcl6search17OrganizedNeighborINS_16PointXYZRGBCamSLEEE[_ZTVN3pcl6search17OrganizedNeighborINS_16PointXYZRGBCamSLEEE]+0x68): undefined reference to
pcl::search::Searchpcl::PointXYZRGBCamSL::nearestKSearch(pcl::PointCloudpcl::PointXYZRGBCamSL const&, std::vector<int, std::allocatorpcl::search::Search<pcl::PointXYZRGBCamSL>::radiusSearch(pcl::PointCloud<pcl::PointXYZRGBCamSL> const&, int, double, std::vector<int, std::allocator<int> >&, std::vector<float, std::allocator<float> >&, unsigned int) const' CMakeFiles/extractOPC.dir/src/extractObjectPointclouds.cpp.o:(.rodata._ZTVN3pcl6search17OrganizedNeighborINS_16PointXYZRGBCamSLEEE[_ZTVN3pcl6search17OrganizedNeighborINS_16PointXYZRGBCamSLEEE]+0x80): undefined reference to
pcl::search::Searchpcl::PointXYZRGBCamSL::radiusSearch(int, double, std::vector<int, std::allocatorpcl::search::Search<pcl::PointXYZRGBCamSL>::radiusSearch(pcl::PointCloud<pcl::PointXYZRGBCamSL> const&, std::vector<int, std::allocator<int> > const&, double, std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >&, std::vector<std::vector<float, std::allocator<float> >, std::allocator<std::vector<float, std::allocator<float> > > >&, unsigned int) const' CMakeFiles/extractOPC.dir/src/extractObjectPointclouds.cpp.o:(.rodata._ZTVN3pcl16NormalEstimationINS_16PointXYZRGBCamSLENS_6NormalEEE[_ZTVN3pcl16NormalEstimationINS_16PointXYZRGBCamSLENS_6NormalEEE]+0x28): undefined reference to
pcl::PCLBasepcl::PointXYZRGBCamSL::setIndices(boost::shared_ptr<std::vector<int, std::allocatorpcl::PCLBase<pcl::PointXYZRGBCamSL>::setIndices(boost::shared_ptr<std::vector<int, std::allocator<int> > const> const&)' CMakeFiles/extractOPC.dir/src/extractObjectPointclouds.cpp.o:(.rodata._ZTVN3pcl16NormalEstimationINS_16PointXYZRGBCamSLENS_6NormalEEE[_ZTVN3pcl16NormalEstimationINS_16PointXYZRGBCamSLENS_6NormalEEE]+0x38): undefined reference to
pcl::PCLBasepcl::PointXYZRGBCamSL::setIndices(boost::shared_ptrpcl::PCLBase<pcl::PointXYZRGBCamSL>::setIndices(unsigned long, unsigned long, unsigned long, unsigned long)' CMakeFiles/extractOPC.dir/src/extractObjectPointclouds.cpp.o:(.rodata._ZTVN3pcl7FeatureINS_16PointXYZRGBCamSLENS_6NormalEEE[_ZTVN3pcl7FeatureINS_16PointXYZRGBCamSLENS_6NormalEEE]+0x20): undefined reference to
pcl::PCLBasepcl::PointXYZRGBCamSL::setInputCloud(boost::shared_ptrpcl::PointCloudpcl::PCLBase<pcl::PointXYZRGBCamSL>::setIndices(boost::shared_ptr<std::vector<int, std::allocator<int> > > const&)' CMakeFiles/extractOPC.dir/src/extractObjectPointclouds.cpp.o:(.rodata._ZTVN3pcl7FeatureINS_16PointXYZRGBCamSLENS_6NormalEEE[_ZTVN3pcl7FeatureINS_16PointXYZRGBCamSLENS_6NormalEEE]+0x30): undefined reference to
pcl::PCLBasepcl::PointXYZRGBCamSL::setIndices(boost::shared_ptr<std::vector<int, std::allocatorpcl::PCLBase<pcl::PointXYZRGBCamSL>::setIndices(boost::shared_ptr<pcl::PointIndices const> const&)' CMakeFiles/extractOPC.dir/src/extractObjectPointclouds.cpp.o:(.rodata._ZTVN3pcl7FeatureINS_16PointXYZRGBCamSLENS_6NormalEEE[_ZTVN3pcl7FeatureINS_16PointXYZRGBCamSLENS_6NormalEEE]+0x40): undefined reference to
pcl::PCLBasepcl::PointXYZRGBCamSL::setIndices(unsigned long, unsigned long, unsigned long, unsigned long)'
CMakeFiles/extractOPC.dir/src/extractObjectPointclouds.cpp.o:(.rodata._ZTVN3pcl7PCLBaseINS_16PointXYZRGBCamSLEEE[_ZTVN3pcl7PCLBaseINS_16PointXYZRGBCamSLEEE]+0x20): undefined reference to pcl::PCLBase<pcl::PointXYZRGBCamSL>::setInputCloud(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGBCamSL> const> const&)' CMakeFiles/extractOPC.dir/src/extractObjectPointclouds.cpp.o:(.rodata._ZTVN3pcl7PCLBaseINS_16PointXYZRGBCamSLEEE[_ZTVN3pcl7PCLBaseINS_16PointXYZRGBCamSLEEE]+0x28): undefined reference to
pcl::PCLBasepcl::PointXYZRGBCamSL::setIndices(boost::shared_ptr<std::vector<int, std::allocatorpcl::PCLBase<pcl::PointXYZRGBCamSL>::setIndices(boost::shared_ptr<std::vector<int, std::allocator<int> > const> const&)' CMakeFiles/extractOPC.dir/src/extractObjectPointclouds.cpp.o:(.rodata._ZTVN3pcl7PCLBaseINS_16PointXYZRGBCamSLEEE[_ZTVN3pcl7PCLBaseINS_16PointXYZRGBCamSLEEE]+0x38): undefined reference to
pcl::PCLBasepcl::PointXYZRGBCamSL::setIndices(boost::shared_ptrpcl::PCLBase<pcl::PointXYZRGBCamSL>::setIndices(unsigned long, unsigned long, unsigned long, unsigned long)' CMakeFiles/extractOPC.dir/src/extractObjectPointclouds.cpp.o:(.rodata._ZTVN3pcl6search6SearchINS_16PointXYZRGBCamSLEEE[_ZTVN3pcl6search6SearchINS_16PointXYZRGBCamSLEEE]+0x20): undefined reference to
pcl::search::Searchpcl::PointXYZRGBCamSL::getName() const'
CMakeFiles/extractOPC.dir/src/extractObjectPointclouds.cpp.o:(.rodata._ZTVN3pcl6search6SearchINS_16PointXYZRGBCamSLEEE[_ZTVN3pcl6search6SearchINS_16PointXYZRGBCamSLEEE]+0x28): undefined reference to pcl::search::Search<pcl::PointXYZRGBCamSL>::setSortedResults(bool)' CMakeFiles/extractOPC.dir/src/extractObjectPointclouds.cpp.o:(.rodata._ZTVN3pcl6search6SearchINS_16PointXYZRGBCamSLEEE[_ZTVN3pcl6search6SearchINS_16PointXYZRGBCamSLEEE]+0x30): undefined reference to
pcl::search::Searchpcl::PointXYZRGBCamSL::getSortedResults()'
CMakeFiles/extractOPC.dir/src/extractObjectPointclouds.cpp.o:(.rodata._ZTVN3pcl6search6SearchINS_16PointXYZRGBCamSLEEE[_ZTVN3pcl6search6SearchINS_16PointXYZRGBCamSLEEE]+0x38): undefined reference to pcl::search::Search<pcl::PointXYZRGBCamSL>::setInputCloud(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGBCamSL> const> const&, boost::shared_ptr<std::vector<int, std::allocator<int> > const> const&)' CMakeFiles/extractOPC.dir/src/extractObjectPointclouds.cpp.o:(.rodata._ZTVN3pcl6search6SearchINS_16PointXYZRGBCamSLEEE[_ZTVN3pcl6search6SearchINS_16PointXYZRGBCamSLEEE]+0x58): undefined reference to
pcl::search::Searchpcl::PointXYZRGBCamSL::nearestKSearch(pcl::PointCloudpcl::PointXYZRGBCamSL const&, int, int, std::vector<int, std::allocatorpcl::search::Search<pcl::PointXYZRGBCamSL>::nearestKSearch(int, int, std::vector<int, std::allocator<int> >&, std::vector<float, std::allocator<float> >&) const' CMakeFiles/extractOPC.dir/src/extractObjectPointclouds.cpp.o:(.rodata._ZTVN3pcl6search6SearchINS_16PointXYZRGBCamSLEEE[_ZTVN3pcl6search6SearchINS_16PointXYZRGBCamSLEEE]+0x68): undefined reference to
pcl::search::Searchpcl::PointXYZRGBCamSL::nearestKSearch(pcl::PointCloudpcl::PointXYZRGBCamSL const&, std::vector<int, std::allocatorpcl::search::Search<pcl::PointXYZRGBCamSL>::radiusSearch(pcl::PointCloud<pcl::PointXYZRGBCamSL> const&, int, double, std::vector<int, std::allocator<int> >&, std::vector<float, std::allocator<float> >&, unsigned int) const' CMakeFiles/extractOPC.dir/src/extractObjectPointclouds.cpp.o:(.rodata._ZTVN3pcl6search6SearchINS_16PointXYZRGBCamSLEEE[_ZTVN3pcl6search6SearchINS_16PointXYZRGBCamSLEEE]+0x80): undefined reference to
pcl::search::Searchpcl::PointXYZRGBCamSL::radiusSearch(int, double, std::vector<int, std::allocatorpcl::search::Search<pcl::PointXYZRGBCamSL>::radiusSearch(pcl::PointCloud<pcl::PointXYZRGBCamSL> const&, std::vector<int, std::allocator<int> > const&, double, std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >&, std::vector<std::vector<float, std::allocator<float> >, std::allocator<std::vector<float, std::allocator<float> > > >&, unsigned int) const' CMakeFiles/extractOPC.dir/src/extractObjectPointclouds.cpp.o: In function
pcl::search::OrganizedNeighborpcl::PointXYZRGBCamSL::radiusSearch(pcl::PointXYZRGBCamSL const&, double, std::vector<int, std::allocatorpcl::search::Search<pcl::PointXYZRGBCamSL>::sortResults(std::vector<int, std::allocator<int> >&, std::vector<float, std::allocator<float> >&) const' /usr/include/pcl-1.7/pcl/search/impl/organized.hpp:111: undefined reference to
pcl::search::Searchpcl::PointXYZRGBCamSL::sortResults(std::vector<int, std::allocator
@hemakoppula Hi, I also met the error as people mentioned above. Do you have any ideas to fix it? Thank you and best regards.
The error occurs because the .hpp header file is not mentioned in the code. Include the corresponding .hpp header files for all the errors thrown and it should solve it.
@syahirulfitri I am getting similar errors as you mentioned in your post. Have you figured out the reasons behind such errors?
in pcl1.7 if you want to add some new point types, it is necessary to include impl header files .hpp as well. make sure all these header files
pcl/impl/pcl_base.hpp pcl/kdtree/impl/kdtree_flann.hpp pcl/search/impl/kdtree.hpp pcl/search/impl/organized.hpp pcl/features/impl/normal_3d.hpp
are included in the pointcloudClustering.h
Besides "eps" is predefined in pcl/boost library, d'better change a name for "eps".
Hi, @Sekunde Thanks a lot :)
@Sekunde Thanks a bunch for that!
add this to CMakeLists.txt
find_package (PCL 1.8 REQUIRED)
set(PCL_INCLUDE_DIRS /usr/local/include/pcl-1.8) #指定pcl1.8路径
include_directories( ... ${PCL_INCLUDE_DIRS})
target_link_libraries( ... ${PCL_LIBRARIES})
Hi, when i'm trying to compile these error comes out.
make Scanning dependencies of target extractOPC [ 16%] Building CXX object CMakeFiles/extractOPC.dir/src/extractObjectPointclouds.cpp.o In file included from /home/mohay019/human_activity_labeling-master/feature_generation_pcl/src/pointcloudClustering.h:10:0, from /home/mohay019/human_activity_labeling-master/feature_generation_pcl/src/frame.cpp:3, from /home/mohay019/human_activity_labeling-master/feature_generation_pcl/src/extractObjectPointclouds.cpp:42: /usr/include/pcl-1.7/pcl/kdtree/impl/kdtree_flann.hpp:74:51: error: expected ‘,’ or ‘...’ before numeric constant /home/mohay019/human_activity_labeling-master/feature_generationpcl/src/extractObjectPointclouds.cpp: In function ‘int main(int, char*)’: /home/mohay019/human_activity_labeling-master/feature_generation_pcl/src/extractObjectPointclouds.cpp:359:70: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘std::vectorstd::basic_string::sizetype {aka long unsigned int}’ [-Wformat]
make[2]: ** [CMakeFiles/extractOPC.dir/src/extractObjectPointclouds.cpp.o] Error 1
make[1]: * [CMakeFiles/extractOPC.dir/all] Error 2
make: * [all] Error 2