PCL在ubuntu下运行提示undefined reference to symbol ‘pthread_condattr_setclock

当PCL代码从win10移植到ubuntu中,cmakelist无法链接boost库,于是要更改cmakelists.txt文件如下。
XXX为cpp文件名称,按需更改即可

cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
project(XXX)
find_package(PCL 1.2 REQUIRED)
include_directories(${PCL_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
find_package(Boost REQUIRED COMPONENTS thread filesystem)
link_libraries(${Boost_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})
add_executable (XXX XXX.cpp)
target_link_libraries (XXX ${PCL_LIBRARIES} ${Boost_LIBRARIES})

原链接:C++中Boost使用出现错误undefined reference to `boost

你可能感兴趣的:(环境配置,PCL,c++)