Code::Blocks Forums
User forums => Using Code::Blocks => Topic started by: fili on July 10, 2006, 01:46:44 pm
-
Hmm, I'm a little embarassed because I don't know if my problem is C::B related or gcc related.
I want to create a project with subdirectories. Something like: the main.cpp in the root, then CTest.h and CTest.cpp in a subdirectory called src. If I want to include the header in main.cpp it's easy, just
But if I want to include the same header in CTest.cpp I should write
because both CTest.h and CTest.cpp are in the same folder. This doesn't work. If I do the same as for main.cpp, it works.
Now my question: is there some setting I should... err... set :D in C::B (May 24th build) in order for this to work as expected? Or is it a gcc problem? In VC6.0 it works, in gcc it doesn't.
Thanks, Fili
-
yes, it's easy ;-)
In your sources just do :
#include "Test.h"
and on your project (or target) you can set a list of directories the compiler should use for looking for included headers.
Check you project build options : directories ...
-
...or if you want a behaviour similar to MSVC's do this:
"Settings->Compiler & debugger->Global compiler settings->Other" and check "Explicitely add currently compiling file's directory to search dirs".
-
Thank you, it works. 8)