Cannot include a header in MinGW

2019-08-06 09:57发布

I'm using SublimeText with MinGW on Windows 7 an wanted to include

#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.

This is the path to the include folder: C:\MinGW\include\

Should I add something like? (from what I could "understand")

-I C:/MinGW/include/boost

But it doesn't work...

2条回答
forever°为你锁心
2楼-- · 2019-08-06 10:25

UPDATE:

"-IC:/MinGW/include"

Oh okay, I figured it out.

So... I have all the necessary libraries here 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...

So in the end I get C:\MinGW\include\c++\4.9.1\boost with all the necessary libraries inside. Now it works.

查看更多
乱世女痞
3楼-- · 2019-08-06 10:37

you need to install boost (from boost.org). http://www.boost.org/users/history/version_1_57_0.html

your #include already starts with boost/ so it will look in include/boost.

查看更多
登录 后发表回答