Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: Turrican on June 22, 2007, 02:41:26 am

Title: How to set relative include path?
Post by: Turrican 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.
Title: Re: How to set relative include path?
Post by: MortenMacFly 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
Title: Re: How to set relative include path?
Post by: Turrican on June 22, 2007, 02:36:48 pm
Thanks, worked instantly.