从源构建 pcl 1.7.2

Building pcl 1.7.2 from source

我想在 Ubuntu 18.04.3 上构建 pcl 库版本 1.7.2,我有 cmake 版本 3.10.2

当我 运行 cmake 命令时,我收到以下错误消息:

CMake Error at /usr/share/cmake-3.10/Modules/FindBoost.cmake:1947 (message):
  Unable to find the requested Boost libraries.

  Boost version: 1.65.1

  Boost include path: /usr/include

  Could not find the following Boost libraries:

          boost_system
          boost_filesystem
          boost_thread

当我写 whereis boost 时,我得到以下结果:

boost: /usr/include/boost

当我看到 /usr/include/boost/version.hpp 的内容时,它是 1.65.1 版本。

令我困惑的是为什么这个 cmake 失败了?

我设置这个选项 set(Boost_DEBUG 1) 来查看 find boost 的调试输出,它给了我这个结果:

-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1096 ] Boost_USE_MULTITHREADED = TRUE
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1098 ] Boost_USE_STATIC_LIBS = 
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1100 ] Boost_USE_STATIC_RUNTIME = 
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1102 ] Boost_ADDITIONAL_VERSIONS = 1.47;1.47.0;1.48;1.48.0;1.49;1.49.0
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1104 ] Boost_NO_SYSTEM_PATHS = 
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1172 ] Declared as CMake or Environmental Variables:
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1174 ]   BOOST_ROOT = /usr/lib/x86_64-linux-gnu/
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1176 ]   BOOST_INCLUDEDIR = /usr/include/boost
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1178 ]   BOOST_LIBRARYDIR = 
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1180 ] _boost_TEST_VERSIONS = 1.47;1.47.0;1.48;1.48.0;1.49;1.49.0;1.65.1;1.65.0;1.65;1.64.0;1.64;1.63.0;1.63;1.62.0;1.62;1.61.0;1.61;1.60.0;1.60;1.59.0;1.59;1.58.0;1.58;1.57.0;1.57;1.56.0;1.56;1.55.0;1.55;1.54.0;1.54;1.53.0;1.53;1.52.0;1.52;1.51.0;1.51;1.50.0;1.50;1.49.0;1.49;1.48.0;1.48;1.47.0;1.47
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1255 ] Include debugging info:
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1257 ]   _boost_INCLUDE_SEARCH_DIRS = /usr/include/boost;/usr/lib/x86_64-linux-gnu//include;/usr/lib/x86_64-linux-gnu/;PATHS;C:/boost/include;C:/boost;/sw/local/include
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1259 ]   _boost_PATH_SUFFIXES = boost-1_47;boost_1_47;boost/boost-1_47;boost/boost_1_47;boost-1_47_0;boost_1_47_0;boost/boost-1_47_0;boost/boost_1_47_0;boost-1_48;boost_1_48;boost/boost-1_48;boost/boost_1_48;boost-1_48_0;boost_1_48_0;boost/boost-1_48_0;boost/boost_1_48_0;boost-1_49;boost_1_49;boost/boost-1_49;boost/boost_1_49;boost-1_49_0;boost_1_49_0;boost/boost-1_49_0;boost/boost_1_49_0;boost-1_65_1;boost_1_65_1;boost/boost-1_65_1;boost/boost_1_65_1;boost-1_65_0;boost_1_65_0;boost/boost-1_65_0;boost/boost_1_65_0;boost-1_65;boost_1_65;boost/boost-1_65;boost/boost_1_65;boost-1_64_0;boost_1_64_0;boost/boost-1_64_0;boost/boost_1_64_0;boost-1_64;boost_1_64;boost/boost-1_64;boost/boost_1_64;boost-1_63_0;boost_1_63_0;boost/boost-1_63_0;boost/boost_1_63_0;boost-1_63;boost_1_63;boost/boost-1_63;boost/boost_1_63;boost-1_62_0;boost_1_62_0;boost/boost-1_62_0;boost/boost_1_62_0;boost-1_62;boost_1_62;boost/boost-1_62;boost/boost_1_62;boost-1_61_0;boost_1_61_0;boost/boost-1_61_0;boost/boost_1_61_0;boost-1_61;boost_1_61;boost/boost-1_61;boost/boost_1_61;boost-1_60_0;boost_1_60_0;boost/boost-1_60_0;boost/boost_1_60_0;boost-1_60;boost_1_60;boost/boost-1_60;boost/boost_1_60;boost-1_59_0;boost_1_59_0;boost/boost-1_59_0;boost/boost_1_59_0;boost-1_59;boost_1_59;boost/boost-1_59;boost/boost_1_59;boost-1_58_0;boost_1_58_0;boost/boost-1_58_0;boost/boost_1_58_0;boost-1_58;boost_1_58;boost/boost-1_58;boost/boost_1_58;boost-1_57_0;boost_1_57_0;boost/boost-1_57_0;boost/boost_1_57_0;boost-1_57;boost_1_57;boost/boost-1_57;boost/boost_1_57;boost-1_56_0;boost_1_56_0;boost/boost-1_56_0;boost/boost_1_56_0;boost-1_56;boost_1_56;boost/boost-1_56;boost/boost_1_56;boost-1_55_0;boost_1_55_0;boost/boost-1_55_0;boost/boost_1_55_0;boost-1_55;boost_1_55;boost/boost-1_55;boost/boost_1_55;boost-1_54_0;boost_1_54_0;boost/boost-1_54_0;boost/boost_1_54_0;boost-1_54;boost_1_54;boost/boost-1_54;boost/boost_1_54;boost-1_53_0;boost_1_53_0;boost/boost-1_53_0;boost/boost_1_53_0;boost-1_53;boost_1_53;boost/boost-1_53;boost/boost_1_53;boost-1_52_0;boost_1_52_0;boost/boost-1_52_0;boost/boost_1_52_0;boost-1_52;boost_1_52;boost/boost-1_52;boost/boost_1_52;boost-1_51_0;boost_1_51_0;boost/boost-1_51_0;boost/boost_1_51_0;boost-1_51;boost_1_51;boost/boost-1_51;boost/boost_1_51;boost-1_50_0;boost_1_50_0;boost/boost-1_50_0;boost/boost_1_50_0;boost-1_50;boost_1_50;boost/boost-1_50;boost/boost_1_50;boost-1_49_0;boost_1_49_0;boost/boost-1_49_0;boost/boost_1_49_0;boost-1_49;boost_1_49;boost/boost-1_49;boost/boost_1_49;boost-1_48_0;boost_1_48_0;boost/boost-1_48_0;boost/boost_1_48_0;boost-1_48;boost_1_48;boost/boost-1_48;boost/boost_1_48;boost-1_47_0;boost_1_47_0;boost/boost-1_47_0;boost/boost_1_47_0;boost-1_47;boost_1_47;boost/boost-1_47;boost/boost_1_47
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1279 ] location of version.hpp: /usr/include/boost/version.hpp
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1303 ] version.hpp reveals boost 1.65.1
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1389 ] guessed _boost_COMPILER = -gcc48
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1399 ] _boost_MULTITHREADED = -mt
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1443 ] _boost_RELEASE_ABI_TAG = -
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1445 ] _boost_DEBUG_ABI_TAG = -d
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1507 ] _boost_LIBRARY_SEARCH_DIRS_RELEASE = /usr/lib/x86_64-linux-gnu//lib;/usr/lib/x86_64-linux-gnu//stage/lib;/usr/include/lib;/usr/include/../lib;/usr/include/stage/lib;PATHS;C:/boost/lib;C:/boost;/sw/local/lib_boost_LIBRARY_SEARCH_DIRS_DEBUG   = /usr/lib/x86_64-linux-gnu//lib;/usr/lib/x86_64-linux-gnu//stage/lib;/usr/include/lib;/usr/include/../lib;/usr/include/stage/lib;PATHS;C:/boost/lib;C:/boost;/sw/local/lib
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1657 ] Searching for SERIALIZATION_LIBRARY_RELEASE: boost_serialization-gcc48-mt-1_65_1;boost_serialization-gcc48-mt;boost_serialization-mt-1_65_1;boost_serialization-mt;boost_serialization
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:380 ]  Boost_LIBRARY_DIR_RELEASE = /usr/lib/x86_64-linux-gnu _boost_LIBRARY_SEARCH_DIRS_RELEASE = /usr/lib/x86_64-linux-gnu;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1708 ] Searching for SERIALIZATION_LIBRARY_DEBUG: boost_serialization-gcc48-mt-d-1_65_1;boost_serialization-gcc48-mt-d;boost_serialization-mt-d-1_65_1;boost_serialization-mt-d;boost_serialization-mt;boost_serialization
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:380 ]  Boost_LIBRARY_DIR_DEBUG = /usr/lib/x86_64-linux-gnu _boost_LIBRARY_SEARCH_DIRS_DEBUG = /usr/lib/x86_64-linux-gnu;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1657 ] Searching for MPI_LIBRARY_RELEASE: boost_mpi-gcc48-mt-1_65_1;boost_mpi-gcc48-mt;boost_mpi-mt-1_65_1;boost_mpi-mt;boost_mpi
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:380 ]  Boost_LIBRARY_DIR_RELEASE = /usr/lib/x86_64-linux-gnu _boost_LIBRARY_SEARCH_DIRS_RELEASE = /usr/lib/x86_64-linux-gnu;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1708 ] Searching for MPI_LIBRARY_DEBUG: boost_mpi-gcc48-mt-d-1_65_1;boost_mpi-gcc48-mt-d;boost_mpi-mt-d-1_65_1;boost_mpi-mt-d;boost_mpi-mt;boost_mpi
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:380 ]  Boost_LIBRARY_DIR_DEBUG = /usr/lib/x86_64-linux-gnu _boost_LIBRARY_SEARCH_DIRS_DEBUG = /usr/lib/x86_64-linux-gnu;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1783 ] Boost_FOUND = 1
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1094 ] _boost_TEST_VERSIONS = 1.47;1.47.0;1.48;1.48.0;1.49;1.49.0;1.65.1;1.65.0;1.65;1.64.0;1.64;1.63.0;1.63;1.62.0;1.62;1.61.0;1.61;1.60.0;1.60;1.59.0;1.59;1.58.0;1.58;1.57.0;1.57;1.56.0;1.56;1.55.0;1.55;1.54.0;1.54;1.53.0;1.53;1.52.0;1.52;1.51.0;1.51;1.50.0;1.50;1.49.0;1.49;1.48.0;1.48;1.47.0;1.47
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1096 ] Boost_USE_MULTITHREADED = TRUE
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1098 ] Boost_USE_STATIC_LIBS = 
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1100 ] Boost_USE_STATIC_RUNTIME = 
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1102 ] Boost_ADDITIONAL_VERSIONS = 1.47;1.47.0;1.48;1.48.0;1.49;1.49.0
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1104 ] Boost_NO_SYSTEM_PATHS = 
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1172 ] Declared as CMake or Environmental Variables:
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1174 ]   BOOST_ROOT = /usr/lib/x86_64-linux-gnu/
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1176 ]   BOOST_INCLUDEDIR = /usr/include/boost
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1178 ]   BOOST_LIBRARYDIR = 
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1180 ] _boost_TEST_VERSIONS = 1.47;1.47.0;1.48;1.48.0;1.49;1.49.0;1.65.1;1.65.0;1.65;1.64.0;1.64;1.63.0;1.63;1.62.0;1.62;1.61.0;1.61;1.60.0;1.60;1.59.0;1.59;1.58.0;1.58;1.57.0;1.57;1.56.0;1.56;1.55.0;1.55;1.54.0;1.54;1.53.0;1.53;1.52.0;1.52;1.51.0;1.51;1.50.0;1.50;1.49.0;1.49;1.48.0;1.48;1.47.0;1.47
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1279 ] location of version.hpp: /usr/include/boost/version.hpp
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1303 ] version.hpp reveals boost 1.65.1
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1389 ] guessed _boost_COMPILER = -gcc48
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1399 ] _boost_MULTITHREADED = -mt
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1443 ] _boost_RELEASE_ABI_TAG = -
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1445 ] _boost_DEBUG_ABI_TAG = -d
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1507 ] _boost_LIBRARY_SEARCH_DIRS_RELEASE = /usr/lib/x86_64-linux-gnu;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH_boost_LIBRARY_SEARCH_DIRS_DEBUG   = /usr/lib/x86_64-linux-gnu;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE  
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1657 ] Searching for SYSTEM_LIBRARY_RELEASE: boost_system-gcc48-mt-1_65_1;boost_system-gcc48-mt;boost_system-mt-1_65_1;boost_system-mt;boost_system
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:380 ]  Boost_LIBRARY_DIR_RELEASE = /usr/lib/x86_64-linux-gnu _boost_LIBRARY_SEARCH_DIRS_RELEASE = /usr/lib/x86_64-linux-gnu;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1708 ] Searching for SYSTEM_LIBRARY_DEBUG: boost_system-gcc48-mt-d-1_65_1;boost_system-gcc48-mt-d;boost_system-mt-d-1_65_1;boost_system-mt-d;boost_system-mt;boost_system
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:380 ]  Boost_LIBRARY_DIR_DEBUG = /usr/lib/x86_64-linux-gnu _boost_LIBRARY_SEARCH_DIRS_DEBUG = /usr/lib/x86_64-linux-gnu;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1657 ] Searching for FILESYSTEM_LIBRARY_RELEASE: boost_filesystem-gcc48-mt-1_65_1;boost_filesystem-gcc48-mt;boost_filesystem-mt-1_65_1;boost_filesystem-mt;boost_filesystem
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:380 ]  Boost_LIBRARY_DIR_RELEASE = /usr/lib/x86_64-linux-gnu _boost_LIBRARY_SEARCH_DIRS_RELEASE = /usr/lib/x86_64-linux-gnu;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1708 ] Searching for FILESYSTEM_LIBRARY_DEBUG: boost_filesystem-gcc48-mt-d-1_65_1;boost_filesystem-gcc48-mt-d;boost_filesystem-mt-d-1_65_1;boost_filesystem-mt-d;boost_filesystem-mt;boost_filesystem
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:380 ]  Boost_LIBRARY_DIR_DEBUG = /usr/lib/x86_64-linux-gnu _boost_LIBRARY_SEARCH_DIRS_DEBUG = /usr/lib/x86_64-linux-gnu;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1657 ] Searching for THREAD_LIBRARY_RELEASE: boost_thread-gcc48-mt-1_65_1;boost_thread-gcc48-mt;boost_thread-mt-1_65_1;boost_thread-mt;boost_thread
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:380 ]  Boost_LIBRARY_DIR_RELEASE = /usr/lib/x86_64-linux-gnu _boost_LIBRARY_SEARCH_DIRS_RELEASE = /usr/lib/x86_64-linux-gnu;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1708 ] Searching for THREAD_LIBRARY_DEBUG: boost_thread-gcc48-mt-d-1_65_1;boost_thread-gcc48-mt-d;boost_thread-mt-d-1_65_1;boost_thread-mt-d;boost_thread-mt;boost_thread
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:380 ]  Boost_LIBRARY_DIR_DEBUG = /usr/lib/x86_64-linux-gnu _boost_LIBRARY_SEARCH_DIRS_DEBUG = /usr/lib/x86_64-linux-gnu;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1657 ] Searching for DATE_TIME_LIBRARY_RELEASE: boost_date_time-gcc48-mt-1_65_1;boost_date_time-gcc48-mt;boost_date_time-mt-1_65_1;boost_date_time-mt;boost_date_time
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:380 ]  Boost_LIBRARY_DIR_RELEASE = /usr/lib/x86_64-linux-gnu _boost_LIBRARY_SEARCH_DIRS_RELEASE = /usr/lib/x86_64-linux-gnu;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1708 ] Searching for DATE_TIME_LIBRARY_DEBUG: boost_date_time-gcc48-mt-d-1_65_1;boost_date_time-gcc48-mt-d;boost_date_time-mt-d-1_65_1;boost_date_time-mt-d;boost_date_time-mt;boost_date_time
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:380 ]  Boost_LIBRARY_DIR_DEBUG = /usr/lib/x86_64-linux-gnu _boost_LIBRARY_SEARCH_DIRS_DEBUG = /usr/lib/x86_64-linux-gnu;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1657 ] Searching for IOSTREAMS_LIBRARY_RELEASE: boost_iostreams-gcc48-mt-1_65_1;boost_iostreams-gcc48-mt;boost_iostreams-mt-1_65_1;boost_iostreams-mt;boost_iostreams
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:380 ]  Boost_LIBRARY_DIR_RELEASE = /usr/lib/x86_64-linux-gnu _boost_LIBRARY_SEARCH_DIRS_RELEASE = /usr/lib/x86_64-linux-gnu;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1708 ] Searching for IOSTREAMS_LIBRARY_DEBUG: boost_iostreams-gcc48-mt-d-1_65_1;boost_iostreams-gcc48-mt-d;boost_iostreams-mt-d-1_65_1;boost_iostreams-mt-d;boost_iostreams-mt;boost_iostreams
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:380 ]  Boost_LIBRARY_DIR_DEBUG = /usr/lib/x86_64-linux-gnu _boost_LIBRARY_SEARCH_DIRS_DEBUG = /usr/lib/x86_64-linux-gnu;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1657 ] Searching for CHRONO_LIBRARY_RELEASE: boost_chrono-gcc48-mt-1_65_1;boost_chrono-gcc48-mt;boost_chrono-mt-1_65_1;boost_chrono-mt;boost_chrono
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:380 ]  Boost_LIBRARY_DIR_RELEASE = /usr/lib/x86_64-linux-gnu _boost_LIBRARY_SEARCH_DIRS_RELEASE = /usr/lib/x86_64-linux-gnu;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1708 ] Searching for CHRONO_LIBRARY_DEBUG: boost_chrono-gcc48-mt-d-1_65_1;boost_chrono-gcc48-mt-d;boost_chrono-mt-d-1_65_1;boost_chrono-mt-d;boost_chrono-mt;boost_chrono
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:380 ]  Boost_LIBRARY_DIR_DEBUG = /usr/lib/x86_64-linux-gnu _boost_LIBRARY_SEARCH_DIRS_DEBUG = /usr/lib/x86_64-linux-gnu;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1657 ] Searching for ATOMIC_LIBRARY_RELEASE: boost_atomic-gcc48-mt-1_65_1;boost_atomic-gcc48-mt;boost_atomic-mt-1_65_1;boost_atomic-mt;boost_atomic
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:380 ]  Boost_LIBRARY_DIR_RELEASE = /usr/lib/x86_64-linux-gnu _boost_LIBRARY_SEARCH_DIRS_RELEASE = /usr/lib/x86_64-linux-gnu;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1708 ] Searching for ATOMIC_LIBRARY_DEBUG: boost_atomic-gcc48-mt-d-1_65_1;boost_atomic-gcc48-mt-d;boost_atomic-mt-d-1_65_1;boost_atomic-mt-d;boost_atomic-mt;boost_atomic
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:380 ]  Boost_LIBRARY_DIR_DEBUG = /usr/lib/x86_64-linux-gnu _boost_LIBRARY_SEARCH_DIRS_DEBUG = /usr/lib/x86_64-linux-gnu;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1657 ] Searching for REGEX_LIBRARY_RELEASE: boost_regex-gcc48-mt-1_65_1;boost_regex-gcc48-mt;boost_regex-mt-1_65_1;boost_regex-mt;boost_regex
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:380 ]  Boost_LIBRARY_DIR_RELEASE = /usr/lib/x86_64-linux-gnu _boost_LIBRARY_SEARCH_DIRS_RELEASE = /usr/lib/x86_64-linux-gnu;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1708 ] Searching for REGEX_LIBRARY_DEBUG: boost_regex-gcc48-mt-d-1_65_1;boost_regex-gcc48-mt-d;boost_regex-mt-d-1_65_1;boost_regex-mt-d;boost_regex-mt;boost_regex
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:380 ]  Boost_LIBRARY_DIR_DEBUG = /usr/lib/x86_64-linux-gnu _boost_LIBRARY_SEARCH_DIRS_DEBUG = /usr/lib/x86_64-linux-gnu;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH
-- [ /usr/share/cmake-3.10/Modules/FindBoost.cmake:1783 ] Boost_FOUND = 1
CMake Error at /usr/share/cmake-3.10/Modules/FindBoost.cmake:1947 (message):
  Unable to find the requested Boost libraries.

  Boost version: 1.65.1

  Boost include path: /usr/include

  Could not find the following Boost libraries:

          boost_system
          boost_filesystem
          boost_thread

  Some (but not all) of the required Boost libraries were found.  You may
  need to install these additional Boost libraries.  Alternatively, set
  BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT
  to the location of Boost.

网上类似的解决方案建议显式设置BOOST_ROOTBOOST_INCLUDEDIRBOOST_LIBRARYDIR,但我不知道应该为它们设置什么值,我尝试了这两个我的 cmake 文件中的代码行但仍然出现相同的错误(我还删除了构建文件夹...)

SET(BOOST_ROOT "/usr/lib/x86_64-linux-gnu/")
SET(BOOST_INCLUDEDIR "/usr/include/boost")

非常感谢任何帮助,我已经好几天没有遇到这个问题了,这是我第一次接触构建 C++ 解决方案。

编辑: 当我写这个命令时:ls /usr/lib/x86_64-linux-gnu/libboost*.so 它不显示 boost_system boost_filesystemboost_thread !虽然我用这个命令安装了 boost:sudo apt-get install libboost-all-dev

我设法通过完全删除 boost 并重新安装来解决它。