目录
问题:
运行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