In a new project I am working on I have the following dir structure:
Project_base
|---- src
|---- bin
|---- h
| Makefile
And in my source files I have includes that look like so:
#include "../h/SomeHeaderFile.h"
instead of the more correct form:
#include "SomeHeaderFile.h"
What do I need to add to my makefile so that I can removed the relative path includes so they will look normal?
ADDITION: also, where do I set this in CDT (C++ for eclipse) so that in design time this is reflected as well?
You need to add
-I../h
in the list of parameters you pass to gcc.Add a flag to your CFLAGS so that the root of the headers is part of the headers search path:
That way gcc/g++ will also look here in addition to the default headers directories.