boost 库路径包括

标签 boost mingw

我安装了 boost v.1.51.0 并且目录“boost_1_51_0”位于“/home/user1/boost/”下。要安装,我只是将 tar 文件解压缩到“/home/user1/boost/”中。我在 MinGW 上使用 C++ 编译器。

现在,我正在尝试在代码中包含这些库。到目前为止我试过了

#include </home/user1/boost/boost_1_51_0/libs/unordered/test/objects/test.hpp>  
#include </home/user1/boost/boost_1_51_0/test.hpp>
#include </home/user1/boost/test.hpp>
#include <boost/test.hpp>

与其他一些人一起。我什至尝试将“/home/user1/boost/”的 Windows 位置添加到路径中。

我错过了一些东西。

最佳答案

您需要使用命令行参数向编译器提供包含目录,例如-I/home/user1/boost/boost_1_51_0.

您可能还想将 boost 实际安装到系统目录;见 http://www.boost.org/doc/libs/1_51_0/doc/html/bbv2/installation.html了解详情。

关于 boost 库路径包括,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12127458/

相关文章:

c++ - 链接到 boost 1.63 静态库时引用未定义

c++ - 使用多线程 boost 条件变量

c++ - 使用单独的 Boost 库编译,无需安装 Boost

c++ - header 中的 std::map 链接器失败

parsing - 如何以 boost spirit 正确解析保留字

c++ - thread_specific_ptr 多线程混淆

c++ - MinGW 和 std::thread

mingw - MSYS 与 MinGW : internal environment variables

c++ - 如何将gsl添加到MinGW?

windows - 在 Ubuntu Linux 中从 Eclipse 交叉编译 Windows 应用程序?