mzh_zju
mzh_zju
2018-11-10 06:25

ubuntu 跑pcl程序的时候,cmake发现了boost,但是make的时候还是报错提示boost_system无法加载

5
  • ubuntu
  • pcl
  • boost

这个是cmake的语句

cmake -lboost_system -lboost_thread ..

这个是cmake的结果前后部分(中间截了)

-- Eigen found (include: /usr/include/eigen3, version: 3.3.4)
-- Boost version: 1.65.1
-- Found the following Boost libraries:
--   system
--   filesystem
--   thread
--   date_time
--   iostreams
--   serialization
--   chrono
--   atomic
--   regex
.......
** WARNING ** io features related to pcap will be disabled
** WARNING ** io features related to png will be disabled
** WARNING ** io features related to libusb-1.0 will be disabled
-- looking for PCL_SIMULATION
-- Boost version: 1.65.1
-- Found the following Boost libraries:
--   system
--   filesystem
--   thread
--   chrono
--   date_time
--   atomic
-- Configuring done
-- Generating done

这个是make的结果

 /usr/bin/x86_64-linux-gnu-ld: CMakeFiles/mesh.dir/meshtest.cpp.o: undefined reference to symbol '_ZN5boost6system15system_categoryEv'
//usr/lib/x86_64-linux-gnu/libboost_system.so.1.65.1: 无法添加符号: DSO missing from command line

这个是cmakelists

 cmake_minimum_required(VERSION 3.3)
project(meshtest CXX)
find_package(PCL 1.8 REQUIRED)
find_package(Boost REQUIRED COMPONENTS system filesystem thread)
if (NOT Boost_FOUND)
message("未发现Boost")
endif()
include_directories(${PCL_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS} ${Boost_LIBRARY_DIR})
add_definitions(${PCL_DEFINITIONS})
add_executable(mesh meshtest.cpp)
target_link_libraries(mesh ${PCL_COMMON_LIBRARIES} ${PCL_IO_LIBRARIES})

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

1条回答