简体   繁体   English

MinGW中不能包含标题

[英]Cannot include a header in MinGW

I'm using SublimeText with MinGW on Windows 7 an wanted to include 我在Windows 7上将SublimeText与MinGW结合使用,希望包含

#include <boost/multiprecision/cpp_int.hpp> 

but I get 但我明白了

fatal error: boost/multiprecision/cpp_int.hpp: No such file or directory
#include <boost/multiprecision/cpp_int.hpp>

Couldn't figure out what to do from what I've found here and in Google. 我在这里和Google都找不到要做什么。

This is the path to the include folder: C:\\MinGW\\include\\ 这是包含文件夹的路径:C:\\ MinGW \\ include \\

Should I add something like? 我应该添加类似的东西吗? (from what I could "understand") (据我所能“理解”的)

-IC:/MinGW/include/boost -IC:/ MinGW的/有/升压

But it doesn't work... 但这行不通...

you need to install boost (from boost.org). 您需要安装boost(来自boost.org)。 http://www.boost.org/users/history/version_1_57_0.html http://www.boost.org/users/history/version_1_57_0.html

your #include already starts with boost/ so it will look in include/boost. 您的#include已经以boost/开头,因此它将出现在include / boost中。

UPDATE: 更新:

"-IC:/MinGW/include" “-IC:/ MinGW的/包括”

Oh okay, I figured it out. 哦,好的,我知道了。

So... I have all the necessary libraries here C:\\MinGW\\include\\ 所以...我这里有所有必要的库C:\\ MinGW \\ include \\

But in order to be able to include boost files (C:\\MinGW\\include\\boost) I needed to copy this folder here C:\\MinGW\\include\\c++\\4.9.1 which is where MinGW was looking for my files... 但是,为了能够包含增强文件(C:\\ MinGW \\ include \\ boost),我需要在此文件夹C:\\ MinGW \\ include \\ c ++ \\ 4.9.1复制该文件夹,这是MinGW在寻找我的文件的位置。 。

So in the end I get C:\\MinGW\\include\\c++\\4.9.1\\boost with all the necessary libraries inside. 所以最后我得到了C:\\ MinGW \\ include \\ c ++ \\ 4.9.1 \\ boost,其中包含所有必需的库。 Now it works. 现在可以了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM