【发布时间】:2017-05-17 08:37:09
【问题描述】:
我目前遇到 Boost 问题。在 CMake 阶段,它明确表示找到了 boost:
-- Boost version: 1.61.0
-- Found the following Boost libraries:
-- filesystem
-- program_options
-- iostreams
-- timer
-- system
-- regex
但是在make阶段从生成的Makefile:
Timer.h(26): catastrophic error: cannot open source file "boost/timer/timer.hpp"
#include <boost/timer/timer.hpp>
[..] ^
Function.h(29): catastrophic error: cannot open source file "boost/ptr_container/ptr_map.hpp"
#include <boost/ptr_container/ptr_map.hpp>
[..]
基本上,Makefile 似乎没有找到任何boost 的标头。我什至已经声明Boost_INCLUDEDIR 和Boost_LIBRARYDIR - 区分大小写。看起来没有帮助。
可能的原因是什么?编译器之间是否存在一些冲突,即gcc/icc 和cmake 生成器? (纯属猜测——我不是这方面的专家……)
编辑:这是在CMakeLists.txt文件中找到boost的过程:http://pastebin.com/7m3yAYk5,FindBOOST.cmake在这里:https://github.com/Kitware/CMake/blob/master/Modules/FindBoost.cmake
【问题讨论】:
-
请编辑您的问题并添加您的
CMakeLists.txt寻找 Boost 的内容。在不知道您如何搜索和使用 Boost 的情况下无法回答您的问题 -
你有这个
include_directories(SYSTEM ${Boost_INCLUDE_DIR})