Could NOT find Boost (missing: program_options system filesystem) (found suitable version “1.66.0“..

目录

问题:

原因:

解决:

参考:


问题:

运行cmake 报错

cmake ..

报如下错误:

CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


${PROJECT_WITH_PROF}: OFF
fatal: not a git repository (or any of the parent directories): .git
branch: 
fatal: not a git repository (or any of the parent directories): .git
commit: 
LIBPCAP: /usr/local/lib/libpcap.so
LIBSTDCPP: /usr/lib64/libstdc++.so.6
LIBGCCS: /usr/lib64/libgcc_s.so.1
CMake Error at /usr/share/cmake-3.21/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find Boost (missing: program_options system filesystem) (found
  suitable version "1.66.0", minimum required is "1.41.0")
Call Stack (most recent call first):
  /usr/share/cmake-3.21/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.21/Modules/FindBoost.cmake:2360 (find_package_handle_standard_args)
  CMakeLists.txt:90 (find_package)


-- Configuring incomplete, errors occurred!
See also "/home/netis/packet-agent-master-src/packet-agent-master/build/CMakeFiles/CMakeOutput.log".

原因:

没有成功引入boost头文件

解决:

运行如下命令,引入boost安装目录

cmake .. -DBOOST_ROOT="/../../boost_1_77_0" -DBOOST_LIBRARYDIR="/../../boost_1_77_0"

参考:

cmake v3.15.3 cannot find boost v1.71.0 - Stack Overflow

boost下载地址:https://boostorg.jfrog.io/artifactory/main/release/1.77.0/source/boost_1_77_0.tar.gz

连接boost目录:

ln -s boost_1_77_0/boost <my-source-path>/include/boost

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值