【发布时间】:2018-01-20 21:48:46
【问题描述】:
cmake - 3.8
我在/usr/local/lib/下编译安装了boost库,但是无法通过find_package(Boost REQUIRED program_options)命令让cmake检测boost program_options。找到所有其他库find_package(Boost REQUIRED thread system),并且仅添加 program_options 会引发错误。我已经尝试了很多东西,但有点不知所措——program_options 有什么特别之处。
-- Boost version: 1.63.0
-- Found the following Boost libraries:
-- filesystem
-- regex
-- serialization
-- unit_test_framework
-- iostreams
-- thread
-- system
-- chrono
-- date_time
-- atomic
boost make 成功并构建了 program_options 库(我可以在 /usr/local/lib/ 文件夹中看到它以及其他 boost 库)。我就是不明白,为什么nt cmake会找到呢?
Error :
Unable to find the requested Boost libraries.
Boost version: 1.63.0
Boost include path: /usr/local/include
Could not find the following Boost libraries:
boost_program_options
Some (but not all) of the required Boost libraries were found. You may
need to install these additional Boost libraries. Alternatively, set
BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT
to the location of Boost.
目录结构
-rw-r--r-- 1 root root 1558464 Aug 12 15:46 /usr/local/lib/libboost_program_options.a
lrwxrwxrwx 1 root root 34 Aug 12 15:46 /usr/local/lib/libboost_program_options.so -> libboost_program_options.so.1.63.0*
-rwxr-xr-x 1 root root 658920 Aug 12 15:46 /usr/local/lib/libboost_program_options.so.1.63.0*
【问题讨论】:
-
发布错误?
-
您的 CMake 是否足够新? stackoverflow.com/a/42124857/2799037
-
@utopia 更新了帖子.. 还发布了 /usr/local/lib 的目录结构。我真的对整个错误感到困惑。