【问题标题】:boost program options config.hpp not found, Mac Xcode 8.3未找到提升程序选项 config.hpp,Mac Xcode 8.3
【发布时间】:2017-07-23 18:29:25
【问题描述】:

尝试使用 boost::program_options 编译简单的示例程序。建议的 lib 包含指令是

#include <boost/program_options.hpp>

我注意到 boost/program_options.hpp 的硬路径(相对于根文件夹)是:

boost/libs/program_options/include/boost/program_options.hpp.

并且根文件夹 boost/program_options/ 的符号链接路径指向硬路径:

boost/libs/program_options/include/boost/program_options/

它比 program_options.hpp 文件低一级。

我假设我应该将 Xcode 中的标题搜索路径设置为

boost/libs/program_options/include/

而不是在提升根?

如果我做前者,我在编辑器中没有错误,并且自动完成工作,但是当我去编译时我得到错误:

致命错误:找不到“boost/config.hpp”文件

#include <boost/config.hpp>

关于如何包含此内容的任何建议?已经使用了 1/2 多个其他 boost 库,没有问题。

【问题讨论】:

  • 嗯...重新安装了 boost dist,发现 /boost/boost/program_options.hpp 中缺少 program_options.hpp 文件。现在,我得到一个不同的错误:架构 x86_64 的未定义符号:“boost::program_options::options_description::m_default_line_length”,引用自:main.o 中的 _main “boost::program_options::options_description::options_description(unsigned int, unsigned int)",引用自:

标签: c++ boost boost-program-options xcode8


【解决方案1】:

更新

抱歉,我错过了这个库不是仅标头。

在使用 program_options 库构建时,它工作正常。

【讨论】:

    猜你喜欢
    • 2018-01-20
    • 2012-07-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-12-13
    • 2018-08-29
    • 1970-01-01
    相关资源
    最近更新 更多