1

How do you make .h files globally accessible by for example #include ? If its compiler specific either migw or gcc. C++

2 Answers 2

3

If I understand your question correctly, you want the "-I" option to the compiler -- this will add a directory to the include-file search path.

Sign up to request clarification or add additional context in comments.

Comments

0

The thing I do, is install headers in

/i686-pc-mingw32/include

libs in

/i686-pc-mingw32/lib

and dll's in

/i686-pc-mingw32/bin

and add that last one to PATH (so relevant dll's will be found by programs you build).

For mingw-w64 switch i686-pc-mingw32 with either i686-w64-mingw32 (32-bit) or x86_64-w64-mingw32 (64-bit).

This allows #include to find the file without any additional -I switches. It is identical to a make install on linux (in most simple cases).

1 Comment

The -I solution is a lot more general. Copying arbitrary files to your default include path seems like a bad idea in general.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.