当我尝试运行“pcl pcl_write.cpp”时,我收到此错误。 cpp文件只是一个测试程序来检查pcl是否正常工作。 (另外,别名是pcl =〜/ .compile.sh)。
arun @ Arun:〜/ pcl_projects / testing_pcl $ pcl pcl_write.cpp
/usr/bin/ld: /tmp/ccQOUJZ2.o: undefined reference to symbol '_ZN5boost6system15system_categoryEv'
/usr/bin/ld: note: '_ZN5boost6system15system_categoryEv' is defined in DSO
/usr/lib/libboost_system.so.1.46.1 so try adding it to the linker command line
/usr/lib/libboost_system.so.1.46.1: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
注意:
.compile.sh包含以下行:
g++ -ggdb -I/usr/lib -I/usr/include/pcl-1.7 -I/usr/include/eigen3 -o `basename $1 .cpp`
$1 `pkg-config --libs pcl_apps-1.7 pcl_common-1.7 pcl_features-1.7
pcl_filters-1.7 pcl_geometry-1.7 pcl_io-1.7 pcl_kdtree-1.7 pcl_keypoints-1.7
pcl_registration-1.7 pcl_sample_consensus-1.7 pcl_search-1.7 pcl_segmentation-1.7
pcl_surface-1.7 pcl_tracking-1.7 pcl_visualization-1.7 flann`;
注意:我可以使用CMAKE进行编译!
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
project(pcl_write)
find_package(PCL 1.7 REQUIRED)
include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})
add_executable (pcl_write pcl_write.cpp)
target_link_libraries (pcl_write ${PCL_LIBRARIES})