Normal estimation problem in pcl-1.6

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Normal estimation problem in pcl-1.6

dwaipayansinha
Hello,

I just installed pcl-1.6 in my Ubuntu 64 bit PC. I was trying out the tutorial for Normal estimation using integral images, but I could not compile the code. Cmake was fine, but then 'make' gave the error below. Please help.

CMakeFiles/test.dir/test.cpp.o: In function `main':
test.cpp:(.text+0x1ac): undefined reference to `pcl::visualization::PCLVisualizer::PCLVisualizer(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)'
test.cpp:(.text+0x205): undefined reference to `pcl::visualization::PCLVisualizer::setBackgroundColor(double const&, double const&, double const&, int)'
test.cpp:(.text+0x2df): undefined reference to `pcl::visualization::PCLVisualizer::spinOnce(int, bool)'
test.cpp:(.text+0x309): undefined reference to `pcl::visualization::PCLVisualizer::~PCLVisualizer()'
test.cpp:(.text+0x318): undefined reference to `pcl::IntegralImageNormalEstimation<pcl::PointXYZ, pcl::Normal>::~IntegralImageNormalEstimation()'
test.cpp:(.text+0x3d0): undefined reference to `pcl::visualization::PCLVisualizer::~PCLVisualizer()'
test.cpp:(.text+0x43c): undefined reference to `pcl::visualization::PCLVisualizer::~PCLVisualizer()'
test.cpp:(.text+0x450): undefined reference to `pcl::IntegralImageNormalEstimation<pcl::PointXYZ, pcl::Normal>::~IntegralImageNormalEstimation()'
CMakeFiles/test.dir/test.cpp.o: In function `pcl::IntegralImageNormalEstimation<pcl::PointXYZ, pcl::Normal>::setInputCloud(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZ> const> const&)':
test.cpp:(.text._ZN3pcl29IntegralImageNormalEstimationINS_8PointXYZENS_6NormalEE13setInputCloudERKN5boost10shared_ptrIKNS_10PointCloudIS1_EEEE[pcl::IntegralImageNormalEstimation<pcl::PointXYZ, pcl::Normal>::setInputCloud(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZ> const> const&)]+0x132): undefined reference to `pcl::IntegralImageNormalEstimation<pcl::PointXYZ, pcl::Normal>::initData()'
CMakeFiles/test.dir/test.cpp.o: In function `bool pcl::visualization::PCLVisualizer::addPointCloudNormals<pcl::PointXYZ, pcl::Normal>(pcl::PointCloud<pcl::PointXYZ>::ConstPtr const&, pcl::PointCloud<pcl::Normal>::ConstPtr const&, int, double, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)':
test.cpp:(.text._ZN3pcl13visualization13PCLVisualizer20addPointCloudNormalsINS_8PointXYZENS_6NormalEEEbRKNS_10PointCloudIT_E8ConstPtrERKNS5_IT0_E8ConstPtrEidRKSsi[bool pcl::visualization::PCLVisualizer::addPointCloudNormals<pcl::PointXYZ, pcl::Normal>(pcl::PointCloud<pcl::PointXYZ>::ConstPtr const&, pcl::PointCloud<pcl::Normal>::ConstPtr const&, int, double, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)]+0x73d): undefined reference to `pcl::visualization::PCLVisualizer::addActorToRenderer(vtkSmartPointer<vtkProp> const&, int)'
CMakeFiles/test.dir/test.cpp.o: In function `pcl::KdTreeFLANN<pcl::PointXYZ, flann::L2_Simple<float> >::~KdTreeFLANN()':
test.cpp:(.text._ZN3pcl11KdTreeFLANNINS_8PointXYZEN5flann9L2_SimpleIfEEED2Ev[_ZN3pcl11KdTreeFLANNINS_8PointXYZEN5flann9L2_SimpleIfEEED5Ev]+0x20): undefined reference to `pcl::KdTreeFLANN<pcl::PointXYZ, flann::L2_Simple<float> >::cleanup()'
CMakeFiles/test.dir/test.cpp.o:(.rodata._ZTVN3pcl11KdTreeFLANNINS_8PointXYZEN5flann9L2_SimpleIfEEEE[vtable for pcl::KdTreeFLANN<pcl::PointXYZ, flann::L2_Simple<float> >]+0x10): undefined reference to `pcl::KdTreeFLANN<pcl::PointXYZ, flann::L2_Simple<float> >::setInputCloud(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZ> const> const&, boost::shared_ptr<std::vector<int, std::allocator<int> > const> const&)'
CMakeFiles/test.dir/test.cpp.o:(.rodata._ZTVN3pcl11KdTreeFLANNINS_8PointXYZEN5flann9L2_SimpleIfEEEE[vtable for pcl::KdTreeFLANN<pcl::PointXYZ, flann::L2_Simple<float> >]+0x28): undefined reference to `pcl::KdTreeFLANN<pcl::PointXYZ, flann::L2_Simple<float> >::nearestKSearch(pcl::PointXYZ const&, int, std::vector<int, std::allocator<int> >&, std::vector<float, std::allocator<float> >&) const'
CMakeFiles/test.dir/test.cpp.o:(.rodata._ZTVN3pcl11KdTreeFLANNINS_8PointXYZEN5flann9L2_SimpleIfEEEE[vtable for pcl::KdTreeFLANN<pcl::PointXYZ, flann::L2_Simple<float> >]+0x40): undefined reference to `pcl::KdTreeFLANN<pcl::PointXYZ, flann::L2_Simple<float> >::radiusSearch(pcl::PointXYZ const&, double, std::vector<int, std::allocator<int> >&, std::vector<float, std::allocator<float> >&, unsigned int) const'
CMakeFiles/test.dir/test.cpp.o:(.rodata._ZTVN3pcl6search17OrganizedNeighborINS_8PointXYZEEE[vtable for pcl::search::OrganizedNeighbor<pcl::PointXYZ>]+0x48): undefined reference to `pcl::search::OrganizedNeighbor<pcl::PointXYZ>::nearestKSearch(pcl::PointXYZ const&, int, std::vector<int, std::allocator<int> >&, std::vector<float, std::allocator<float> >&) const'
CMakeFiles/test.dir/test.cpp.o:(.rodata._ZTVN3pcl6search17OrganizedNeighborINS_8PointXYZEEE[vtable for pcl::search::OrganizedNeighbor<pcl::PointXYZ>]+0x68): 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> >&, unsigned int) const'
CMakeFiles/test.dir/test.cpp.o:(.rodata._ZTVN3pcl29IntegralImageNormalEstimationINS_8PointXYZENS_6NormalEEE[vtable for pcl::IntegralImageNormalEstimation<pcl::PointXYZ, pcl::Normal>]+0x10): undefined reference to `pcl::IntegralImageNormalEstimation<pcl::PointXYZ, pcl::Normal>::~IntegralImageNormalEstimation()'
CMakeFiles/test.dir/test.cpp.o:(.rodata._ZTVN3pcl29IntegralImageNormalEstimationINS_8PointXYZENS_6NormalEEE[vtable for pcl::IntegralImageNormalEstimation<pcl::PointXYZ, pcl::Normal>]+0x18): undefined reference to `pcl::IntegralImageNormalEstimation<pcl::PointXYZ, pcl::Normal>::~IntegralImageNormalEstimation()'
CMakeFiles/test.dir/test.cpp.o:(.rodata._ZTVN3pcl29IntegralImageNormalEstimationINS_8PointXYZENS_6NormalEEE[vtable for pcl::IntegralImageNormalEstimation<pcl::PointXYZ, pcl::Normal>]+0x28): undefined reference to `pcl::IntegralImageNormalEstimation<pcl::PointXYZ, pcl::Normal>::initCompute()'
CMakeFiles/test.dir/test.cpp.o:(.rodata._ZTVN3pcl29IntegralImageNormalEstimationINS_8PointXYZENS_6NormalEEE[vtable for pcl::IntegralImageNormalEstimation<pcl::PointXYZ, pcl::Normal>]+0x38): undefined reference to `pcl::IntegralImageNormalEstimation<pcl::PointXYZ, pcl::Normal>::computeFeature(pcl::PointCloud<pcl::Normal>&)'
CMakeFiles/test.dir/test.cpp.o: In function `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&)':
test.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&)]+0x1ce): undefined reference to `pcl::search::OrganizedNeighbor<pcl::PointXYZ>::estimateProjectionMatrix()'
collect2: ld returned 1 exit status
make[2]: *** [test] Error 1
make[1]: *** [CMakeFiles/test.dir/all] Error 2
make: *** [all] Error 2
Regards,
Dwaipayan
Reply | Threaded
Open this post in threaded view
|

Re: Normal estimation problem in pcl-1.6

Hugo
hi,

i think you're not linking pcl libs properly, see if paths are correct on the cmake file.

Cheers,
Hugo
Reply | Threaded
Open this post in threaded view
|

Re: Normal estimation problem in pcl-1.6

dwaipayansinha
My CMake file:

cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
project(test)
find_package(PCL 1.5 REQUIRED COMPONENTS common io)
include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})
add_executable(test test.cpp)
target_link_libraries(test ${PCL_COMMON_LIBRARIES} ${PCL_IO_LIBRARIES})
Regards,
Dwaipayan
Reply | Threaded
Open this post in threaded view
|

Re: Normal estimation problem in pcl-1.6

Sergey
Administrator
Hi Dwaipayan,

You are only linking against "common" and "io" modules, but you need "visualization" and some others as well. It is usually easier to omit components specification and link against all available modules.

Change

    find_package(PCL 1.5 REQUIRED COMPONENTS common io)

into

    find_package(PCL 1.6 REQUIRED)

and also change the last line from

    target_link_libraries(test ${PCL_COMMON_LIBRARIES} ${PCL_IO_LIBRARIES})

to

    target_link_libraries(test ${PCL_LIBRARIES})

Regards,
Sergey
Reply | Threaded
Open this post in threaded view
|

Re: Normal estimation problem in pcl-1.6

dwaipayansinha
Thank you very much.
Regards,
Dwaipayan