-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to solve undefined reference to `pcl::search::Search<pcl::PointXYZ>::Search? #1
Comments
I'm not sure what the problem is because test_taubin.cpp has an include for pcl/search/organized.h, and the file is linked to PCL libraries (https://github.com/atenpas/agile_grasp/blob/hydro/CMakeLists.txt#L142). Do you have different versions of PCL installed? |
I do not remember I install the version of PCL without ROS or not. |
You could remove all lines related to test_taubin.cpp from CMakeLists.txt. It's just a test file - it's not required to run the ROS nodes. |
After I comment: And I compile again, it shows: |
Any solutions yet? |
My solution was cmake clean and rebuild. Don't understand why. |
add this to
|
My problem is solved after qixuxiang suggestions, Now CMakeLists.txt look like:
|
Including |
I use ubuntu 12.04 64bits with ROS Hydro.
I run:
sudo apt-get install liblapack-dev
git clone https://github.com/atenpas/agile_grasp.git -b hydro
rospack profile
when I catkin_make, it shows errors:
...
[ 74%] Built target handle_search
Scanning dependencies of target localization
CMakeFiles/test_taubin_fitting.dir/src/tests/test_taubin.cpp.o: In function
main': test_taubin.cpp:(.text.startup+0x16b): undefined reference to
pcl::search::Searchpcl::PointXYZ::Search(std::basic_string<char, std::char_traits, std::allocator > const&, bool)'CMakeFiles/test_taubin_fitting.dir/src/tests/test_taubin.cpp.o:(.rodata._ZTVN3pcl6search17OrganizedNeighborINS_8PointXYZEEE[vtable for pcl::search::OrganizedNeighborpcl::PointXYZ]+0x30): undefined reference to
pcl::search::Search<pcl::PointXYZ>::getSortedResults()' CMakeFiles/test_taubin_fitting.dir/src/tests/test_taubin.cpp.o:(.rodata._ZTVN3pcl6search6SearchINS_8PointXYZEEE[vtable for pcl::search::Search<pcl::PointXYZ>]+0x30): undefined reference to
pcl::search::Searchpcl::PointXYZ::getSortedResults()'collect2: ld returned 1 exit status
make[2]: *** [/home/ira/code/ros_hydro/devel/lib/agile_grasp/test_taubin_fitting] Error 1
make[1]: *** [download/agile_grasp/CMakeFiles/test_taubin_fitting.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
CMakeFiles/hands_test.dir/src/tests/hands_test.cpp.o: In function
main': hands_test.cpp:(.text.startup+0x16b): undefined reference to
pcl::search::Searchpcl::PointXYZ::Search(std::basic_string<char, std::char_traits, std::allocator > const&, bool)'CMakeFiles/hands_test.dir/src/tests/hands_test.cpp.o:(.rodata._ZTVN3pcl6search17OrganizedNeighborINS_8PointXYZEEE[vtable for pcl::search::OrganizedNeighborpcl::PointXYZ]+0x30): undefined reference to
pcl::search::Search<pcl::PointXYZ>::getSortedResults()' CMakeFiles/hands_test.dir/src/tests/hands_test.cpp.o:(.rodata._ZTVN3pcl6search6SearchINS_8PointXYZEEE[vtable for pcl::search::Search<pcl::PointXYZ>]+0x30): undefined reference to
pcl::search::Searchpcl::PointXYZ::getSortedResults()'collect2: ld returned 1 exit status
make[2]: *** [/home/ira/code/ros_hydro/devel/lib/agile_grasp/hands_test] Error 1
make[1]: *** [download/agile_grasp/CMakeFiles/hands_test.dir/all] Error 2
[ 76%] Building CXX object download/agile_grasp/CMakeFiles/localization.dir/src/agile_grasp/localization.cpp.o
Linking CXX shared library /home/ira/code/ros_hydro/devel/lib/liblocalization.so
[ 76%] Built target localization
make: *** [all] Error 2
Invoking "make" failed
ira@ira:~/code/ros_hydro$
It's looks like the PCL linking problem.
How to solve it?
Thank you~
The text was updated successfully, but these errors were encountered: