CMake找不到boost
找不到库Boost
1 | set(Boost_DEBUG 1) |
错误
1 | Could NOT find Boost (missing: program_options system) (found suitable version "1.70.0", minimum required is "1.65.0") |
Installing boost on Windows using MinGW-w64 (gcc 64-bit)
在CMakeLists.txt中set(Boost_DEBUG 1)
打印信息
1 | Searching for SYSTEM_LIBRARY_RELEASE: boost_system-mgw13-mt-1_83;boost_system-mgw13-mt;boost_system-mgw13-mt;boost_system-mt-1_83;boost_system-mt;boost_system-mt;boost_system-mt;boost_system |
找不到文件名,所以修改C:\boost\lib
中的文件名称libboost_system-mgw13-mt-d-x64-1_83.dll.a
更改为libboost_system-mgw13-mt-1_83.dll.a
,libboost_program_options-mgw13-mt-d-x64-1_83.dll.a
更改为libboost_program_options-mgw13-mt-1_83.dll.a
。
这里使用的是动态链接库
boost使用静态链接库(static libraries),报错需要libboost_program_options-mgw13-mt-1_83.dll.a
使用静态链接库:将libboost_program_options-mgw13-mt-sd-x64-1_83.a
改名为libboost_program_options-mgw13-mt-1_83.a
。
可选的:在CMakeLists中set(Boost_USE_STATIC_LIBS ON)