Description of the location of header files in the make file

In the new project I'm working on, I have the following dir structure:

Project_base |---- src |---- bin |---- h | Makefile 

And in my source files I have ones that look like this:

 #include "../h/SomeHeaderFile.h" 

instead of a more regular form:

 #include "SomeHeaderFile.h" 

What do I need to add to my makefile so that I can remove the relative path so that they look normal?


ADDITION: where can I install this in a CDT (C ++ for eclipse) so that during development this is reflected as well?
+3
source share
2 answers

You need to add -I../h to the list of options you pass to gcc.

+8
source

Add a flag to your CFLAGS so that the header root is part of the header search path:

 -IProject_base/h 

So gcc / g ++ will also look here in addition to the default header directories.

+2
source

All Articles