find_package( PCL REQUIRED )
include_directories( ${PCL_INCLUDE_DIRS} ) # if we linked catkin libraries again this it will cause ld error;
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})
add_executable(lasertocloud src/scantocloud.cpp)
target_link_libraries(lasertocloud ${PCL_LIBRARIES} ${catkin_LIBRARIES})
如果你 include了多个directories 的话也会报错 ld error 在VS就是link2005

本文详细介绍了在ROS环境中使用PCL(point cloud library)与catkin进行项目构建时遇到的链接错误lderror的问题。文章通过提供具体的CMakeLists.txt配置示例,解释了如何正确地包含PCL的目录、链接库和定义,以避免在Visual Studio中出现link2005错误。此外,还提到了当包含多个目录时可能引发的错误。
961

被折叠的 条评论
为什么被折叠?



