Author Topic: include path  (Read 5525 times)

Offline er

  • Multiple posting newcomer
  • *
  • Posts: 34
include path
« on: April 23, 2008, 03:22:32 am »
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?


Code::Blocks 10.05/ Mac OS X 10.6.4/GCC

Offline Seronis

  • Almost regular
  • **
  • Posts: 197
Re: include path
« Reply #1 on: April 23, 2008, 02:34:35 pm »
Code
#include "root_project/sub/my_header.h"
if you want  'root_project' in the include statement then having
Code
.../root_project/
wont work cause you dont have a 'root_project' inside of the root_project you are searching.  instead you probably just want
Code
.../
in your search paths so your include statement can look as you desire.

HTH

Offline er

  • Multiple posting newcomer
  • *
  • Posts: 34
Re: include path
« Reply #2 on: April 23, 2008, 03:21:44 pm »
yes, that makes sense...thanks!
Code::Blocks 10.05/ Mac OS X 10.6.4/GCC