在CMakeCache.Txt中设置正确的Boost路径

时间:2019-03-22 00:23:55

标签: c++ boost

我正在使用CentOS7系统,需要运行一个使用c ++ boost依赖项的程序。我已按照说明使用此链接https://www.boost.org/doc/libs/1_61_0/more/getting_started/unix-variants.html

获得Boost 1.61

并解压到/ usr / include目录。在boost_1_61_0目录中,还有另一个boost /目录。现在,当我在需要编译的目录中运行cmake .时,出现以下错误:

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

  Boost version: 0.0.0

  Boost include path: /usr/local/include

  Could not find the following Boost libraries:

          boost_system
          boost_log
          boost_program_options
          boost_filesystem

  No Boost libraries were found.  You may need to set BOOST_LIBRARYDIR to the
  directory containing Boost libraries or BOOST_ROOT to the location of
  Boost.
Call Stack (most recent call first):
  CMakeLists.txt:9 (find_package)

在我的CMakeCache.txt文件中,构建目录是正确的,但是我想知道是否需要更改以下路径:

//Path to a file.
Boost_INCLUDE_DIR:PATH=/usr/local/include

/usr/include/

我是不熟悉C语言编译的人,我不确定为什么我的CentOS版本尚未安装boost。

感谢您的帮助。

0 个答案:

没有答案