不能在 MinGW 中包含标头
Cannot include a header in MinGW
我在Windows 7上使用SublimeText和MinGW,并希望包括
#include <boost/multiprecision/cpp_int.hpp>
但我得到
fatal error: boost/multiprecision/cpp_int.hpp: No such file or directory
#include <boost/multiprecision/cpp_int.hpp>
无法从我在这里和谷歌中找到的内容中弄清楚该怎么做。
这是包含文件夹的路径:C:\MinGW\include\
我应该添加类似的东西吗?(根据我能"理解")
-I C:/MinGW/include/boost
但它不起作用...
你需要
安装boost(从 boost.org 开始)。 http://www.boost.org/users/history/version_1_57_0.html
您的#include
已经以boost/
开头,因此它将在包含/提升中查看。
更新:
"-IC:/MinGW/include"
哦,好吧,我想通了。
所以。。。我这里有所有必要的库 C:\MinGW\include\
但是为了能够包含提升文件(C:\MinGW\include\boost),我需要将这个文件夹复制到这里 C:\MinGW\include\c++\4.9.1,这是 MinGW 正在寻找我的文件的地方......
所以最后我得到了 C:\MinGW\include\c++\4.9.1\boost,里面有所有必要的库。现在它起作用了。
相关文章:
- 在CMake中使用find_package时,是否会显式包含标头
- GCC 包含标头(使用"-include")CMake 未检测到的更改
- 使用预处理指令检查是否包含标头?
- 更智能地在C++中包含保护,以便在不同的命名空间中多次包含标头
- 如何在 c++ 中有条件地包含标头?
- main.cpp 如何知道包含标头的源文件?
- 有没有办法告诉 g++ 编译器,而不是在某个 -I 路径中查找包含标头
- QT 如何包含标头和 cpp 文件
- 在 c++ 中,如果包含标头,为什么我会收到'does not a name of type'错误?
- CLion 无法解析类型 std::unordered_map,即使它提示我包含标头并且编译工作
- 是否可以链接到,包括和使用静态库,而无需额外包含标头/文件
- 为什么包含标头会导致"use of auto before deduction of auto"错误?
- 如何告诉qmake在从dbus xml生成文件时包含标头
- GCC Bug,使用尖括号通过宏包含标头时"linux"路径中的字符串"<>"替换为 "1"
- 如何从平台SDK明确包含标头文件
- 包含标头中的搜索路径因编译器而异
- #include < Dbghelp.h> 不包含标头
- 在 main.cpp 以外的文件中包含标头时出现链接器错误
- 尽管包含标头,G++ 链接器仍无法找到函数
- 不能在 MinGW 中包含标头