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

Turrican

  • Guest
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: 9694
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: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Turrican

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