Compilation 点云库(PCL)编译发布UBUNTU 12.04-未定义对符号“_ZN5boost6system15system_categoryEv”的引用

Compilation 点云库(PCL)编译发布UBUNTU 12.04-未定义对符号“_ZN5boost6system15system_categoryEv”的引用,compilation,linker,point-cloud-library,Compilation,Linker,Point Cloud Library,当我尝试运行pcl pcl_write.cpp时,出现此错误。cpp文件只是一个测试程序,用于检查pcl是否正常工作。另外,别名pcl=~/.compile.sh arun@Arun:~/pcl\u项目/testing\u pcl$pcl pcl\u write.cpp /usr/bin/ld: /tmp/ccQOUJZ2.o: undefined reference to symbol '_ZN5boost6system15system_categoryEv' /usr/bin/ld: not

当我尝试运行pcl pcl_write.cpp时,出现此错误。cpp文件只是一个测试程序,用于检查pcl是否正常工作。另外,别名pcl=~/.compile.sh

arun@Arun:~/pcl\u项目/testing\u pcl$pcl pcl\u 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包含以下行:

注意:我可以使用CMAKE进行编译

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_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})