一个项目的用到了boost库,然而在编译时报错:
CMake Error at /usr/share/cmake-3.5/Modules/FindBoost.cmake:1677 (message):
Unable to find the requested Boost libraries.
Boost version: 1.65.1
Boost include path: /usr/include
Could not find the following Boost libraries:
boost_system
boost_iostreams
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.
我明明装了boost库啊,怎么找不到呢,于是用 locate boost_system命令查看,得到:
/usr/lib/x86_64-linux-gnu/libboost_system.so.1.58.0
说吗这个库确实有,只是cmakelists没找到。为啥它找不到呢?因为它找的是libboost_system.so文件,给它加个1.58.0它就找不到了。不过好办,我们建立个软链接:

本文介绍了一种常见问题的解决方案:在使用CMake构建项目时,如何解决找不到已安装的Boost库的问题。通过创建软链接,成功使CMake识别到Boost_system和Boost_iostreams库。
3593

被折叠的 条评论
为什么被折叠?



