【发布时间】: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