Author Topic: How to set relative include path?  (Read 10010 times)

Offline Turrican

  • Single posting newcomer
  • *
  • Posts: 6
How to set relative include path?
« on: June 22, 2007, 02:41:26 am »
Hello

Guess I have a simple question, but I can't find the solution. Well, I thought about giving CB a try, and installed it on my Linux desktop, created a simple C++ testing app where I created a class, and separated the header & source file into the directories base/include and base/src. My problem is, I don't know how to set a relative include path to use #include "myheader.h" instead of ../include/myheader.h for building.

Thanks for help in advance

btw: CB seems to be fine.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9597
Re: How to set relative include path?
« Reply #1 on: June 22, 2007, 08:20:34 am »
I don't know how to set a relative include path to use #include "myheader.h" instead of ../include/myheader.h for building.
Look into your project' build options. There is a tab where you can setup directories for the compiler and linker. You need to add the directory to your header file in the compiler include path's and that basically it. It should correspond then to something like -I..\..\include on the compiler command line then.
With regards, Morten
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline Turrican

  • Single posting newcomer
  • *
  • Posts: 6
Re: How to set relative include path?
« Reply #2 on: June 22, 2007, 02:36:48 pm »
Thanks, worked instantly.