What location does MinGW search when I use <>?

#include <something.h>


I downloaded a library and it cannot be included with local path "" due to the library's include path structure.

So, where does MinGW look for when I use <>? where should I put my external includes?
Last edited on
It looks in its own includes folder. You can also pass additional directories to search in to the command line with the -I flag. It is up to you to decide whether to install the library to your MinGW installation or just reference it on the command line every time.
Last edited on
There is a good amount of debate on how to do this kind of thing on Windows, but it is my personal opinion that you should just stick library code in your MinGW's natural paths.

For example, put all the boost libraries in your MinGW's include directory: for example:

    C:\MinGW\...\include\boost

Then you can properly 'just compile' programs that #include <boost/something.hpp> .


Your application code should be in either the development directory or a subdirectory thereof, and use double quotes. For example:

    C:\Users\yj\Documents\Programming\myprog\myheaders\foo.hpp

And ~myprog\main.cpp can #include "myheaders/foo.hpp" .


The one thing you must be careful about is the difference between 32-bit and 64-bit libraries.


For more exacting help:
- what distribution and version of MinGW are you using?
- and what is the library you downloaded?
Topic archived. No new replies allowed.