User forums > Using Code::Blocks

include path

(1/1)

er:
hi all,

i have project as follows:

//main.cpp
#include "my_header.h"

in Build option's search path, i add say  /.../root_project/sub/

how can i set things up such that i can have:

//main.cpp
#include "root_project/sub/my_header.h"

tried adding /.../root_project as search path in build options and clicking yes for "keep as relative path" but that doesn't seem to be it (what is it for?)

any suggestion?


Seronis:

--- Code: ---#include "root_project/sub/my_header.h"
--- End code ---
if you want  'root_project' in the include statement then having

--- Code: ---.../root_project/
--- End code ---
wont work cause you dont have a 'root_project' inside of the root_project you are searching.  instead you probably just want

--- Code: ---.../
--- End code ---
in your search paths so your include statement can look as you desire.

HTH

er:
yes, that makes sense...thanks!

Navigation

[0] Message Index

Go to full version