不能在 MinGW 中包含标头

Cannot include a header in MinGW

本文关键字:包含标 MinGW 不能      更新时间:2023-10-16

我在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,里面有所有必要的库。现在它起作用了。