Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/cmake/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
即使Boost_LIBRARYDIR设置正确,CMake Find Package Boost也会失败_Cmake_Point Cloud Library - Fatal编程技术网

即使Boost_LIBRARYDIR设置正确,CMake Find Package Boost也会失败

即使Boost_LIBRARYDIR设置正确,CMake Find Package Boost也会失败,cmake,point-cloud-library,Cmake,Point Cloud Library,跑步时 mkdir -p build && cd build && cmake -DCMAKE_INSTALL_PREFIX=/home/install -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=On ..; cd ../ 在第三方库中。我得到以下错误 CMake Error at /usr/local/share/cmake-3.5/Modules/FindBoost.cmake:1657 (mes

跑步时

mkdir -p build && cd build && cmake -DCMAKE_INSTALL_PREFIX=/home/install -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=On ..; cd ../
在第三方库中。我得到以下错误

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

  Boost version: 1.67.0

  Boost include path: /usr/local/include

  Could not find the following static Boost libraries:

          boost_thread
          boost_date_time

  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.
因此,根据我添加的其他几个帖子:

set(BOOST_ROOT /usr/local)
set(BOOST_LIBRARYDIR ${BOOST_ROOT}/lib)
message(STATUS "BOOST_LIBRARYDIR = ${BOOST_LIBRARYDIR}")
到他们的CMakeLists.txt。这给了我以下信息:

-BOOST_LIBRARYDIR=/usr/local/lib -使用CPU本机标志进行SSE优化:-march=native --GCC>4.3已找到,正在启用-Wabi -找到OpenMP

然而,我仍然得到同样的错误。列出BOOST_LIBRARYDIR的内容表明库已经存在

root@74fdb1dd14f4:~/code/pcl# ls /usr/local/lib
cmake                  libboost_prg_exec_monitor.so.1.67.0     libflann.so.1.9
libboost_atomic.a          libboost_program_options.a          libflann.so.1.9.1-003
libboost_atomic.so         libboost_program_options.so         libflann_cpp.so
libboost_atomic.so.1.67.0      libboost_program_options.so.1.67.0      libflann_cpp.so.1.9
libboost_chrono.a          libboost_regex.a                libflann_cpp.so.1.9.1-003
libboost_chrono.so         libboost_regex.so               libflann_cpp_s.a
libboost_chrono.so.1.67.0      libboost_regex.so.1.67.0            libflann_s.a
libboost_date_time.a           libboost_system.a               libload_qos_controller-1.0.1.so
libboost_date_time.so          libboost_system.so              libload_qos_controller.la
libboost_date_time.so.1.67.0   libboost_system.so.1.67.0           libload_qos_controller.so
libboost_filesystem.a          libboost_test_exec_monitor.a        liblogrotate_container_logger-1.0.1.so
libboost_filesystem.so         libboost_thread.a               liblogrotate_container_logger.la
libboost_filesystem.so.1.67.0  libboost_thread.so              liblogrotate_container_logger.so
libboost_graph.a           libboost_thread.so.1.67.0           libmesos-1.0.1.so
libboost_graph.so          libboost_timer.a                libmesos.la
libboost_graph.so.1.67.0       libboost_timer.so               libmesos.so
libboost_log.a             libboost_timer.so.1.67.0            mesos
libboost_log.so            libboost_unit_test_framework.a          mesos-modules
libboost_log.so.1.67.0         libboost_unit_test_framework.so         pkgconfig
libboost_log_setup.a           libboost_unit_test_framework.so.1.67.0  python2.7
libboost_log_setup.so          libfixed_resource_estimator-1.0.1.so    python3.4
libboost_log_setup.so.1.67.0   libfixed_resource_estimator.la          python3.5
libboost_prg_exec_monitor.a    libfixed_resource_estimator.so
libboost_prg_exec_monitor.so   libflann.so

为什么CMake找不到库?

我从命令行猜到您的CMake版本3.5对于Boost 1.67来说太旧了。Boost从1.66.0版开始更改了其命名方案,因此setBoost\u附加的\u版本1.67 1.67.0将不起作用。有关更多详细信息,请参见此。升级您的CMake版本或降低Boost版本要求(如果可能)。

从目录布局判断,它应该是现成的。尝试删除setBOOST*行,清理缓存并再次运行cmake。