catkin_make Image Projection Error with CommonLib
tigeriv opened this issue · 1 comments
Hi, thank you for sharing your code. I am currently trying to run it on ROS Noetic, Ubuntu 20.04 however am unable to fix an error during the catkin_make step. I followed the installation instructions and am able to build LIO-SAM successfully, so I am unsure why I am receiving a build error. Below is the output from catkin_make, which seems to indicate the header file common_lib.h is not being referenced correctly in ImageProjection. Please let me know if you have advice on how to fix this error.
/usr/bin/ld: CMakeFiles/liorf_imageProjection.dir/src/imageProjection.cpp.o: in function void __gnu_cxx::new_allocator<CommonLib::common_lib>::destroy<CommonLib::common_lib>(CommonLib::common_lib*)': /usr/include/c++/9/ext/new_allocator.h:152: undefined reference to
CommonLib::common_lib::~common_lib()'
/usr/bin/ld: CMakeFiles/liorf_imageProjection.dir/src/imageProjection.cpp.o: in function void __gnu_cxx::new_allocator<CommonLib::common_lib>::construct<CommonLib::common_lib, char const (&) [8]>(CommonLib::common_lib*, char const (&) [8])': /usr/include/c++/9/ext/new_allocator.h:146: undefined reference to
CommonLib::common_lib::common_lib(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)'
/usr/bin/ld: CMakeFiles/liorf_imageProjection.dir/src/imageProjection.cpp.o: in function ImageProjection::projectPointCloud()': /home/tigeriv/Code/catkin_ws/src/liorf/src/imageProjection.cpp:580: undefined reference to
float CommonLib::common_lib::pointDistancepcl::PointXYZI(pcl::PointXYZI const&)'
collect2: error: ld returned 1 exit status
make[2]: *** [liorf/CMakeFiles/liorf_imageProjection.dir/build.make:455: /home/tigeriv/Code/catkin_ws/devel/lib/liorf/liorf_imageProjection] Error 1
make[1]: *** [CMakeFiles/Makefile2:9942: liorf/CMakeFiles/liorf_imageProjection.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
/usr/bin/ld: CMakeFiles/liorf_mapOptmization.dir/src/mapOptmization.cpp.o: in function mapOptimization::addGPSFactor()': /home/tigeriv/Code/catkin_ws/src/liorf/src/mapOptmization.cpp:1412: undefined reference to
float CommonLib::common_lib::pointDistancepcl::PointXYZI(pcl::PointXYZI const&, pcl::PointXYZI const&)'
/usr/bin/ld: /home/tigeriv/Code/catkin_ws/src/liorf/src/mapOptmization.cpp:1465: undefined reference to float CommonLib::common_lib::pointDistance<pcl::PointXYZI>(pcl::PointXYZI const&, pcl::PointXYZI const&)' /usr/bin/ld: CMakeFiles/liorf_mapOptmization.dir/src/mapOptmization.cpp.o: in function
mapOptimization::publishGlobalMap()':
/home/tigeriv/Code/catkin_ws/src/liorf/src/mapOptmization.cpp:491: undefined reference to float CommonLib::common_lib::pointDistance<pcl::PointXYZI>(pcl::PointXYZI const&, pcl::PointXYZI const&)' /usr/bin/ld: CMakeFiles/liorf_mapOptmization.dir/src/mapOptmization.cpp.o: in function
mapOptimization::extractCloud(boost::shared_ptr<pcl::PointCloudpcl::PointXYZI >)':
/home/tigeriv/Code/catkin_ws/src/liorf/src/mapOptmization.cpp:1018: undefined reference to `float CommonLib::common_lib::pointDistancepcl::PointXYZI(pcl::PointXYZI const&, pcl::PointXYZI const&)'
collect2: error: ld returned 1 exit status
make[2]: *** [liorf/CMakeFiles/liorf_mapOptmization.dir/build.make:484: /home/tigeriv/Code/catkin_ws/devel/lib/liorf/liorf_mapOptmization] Error 1
make[1]: *** [CMakeFiles/Makefile2:10303: liorf/CMakeFiles/liorf_mapOptmization.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
Thank you for your attention to this work. I have not tested liorf on Ubuntu 20.04, and some template functions have been defined in 'common_lib.cpp'. The detailed function implementation can be viewed from common_lib.cpp.