News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

#include statments don't point to the right directory

Started by Swiftslide, August 17, 2010, 05:31:22 AM

Previous topic - Next topic

Swiftslide

I'm letting Code Blocks manage my project sub-folders. With each new project it creates a src folder (for .cpp files) and an "include" folder (for .h files). The problem lies in creating a class: the cpp file's include statement specifies only the name of the .h file, even though the two files are in different folders. I have to edit each file to include the relative path. Is there any way to fix this, considering Code Blocks is causing it in the first place by putting the .h files and .cpp files in separate folders?

killerbot

yes, specify that include dir as an "include directory" in your project. Then the compiler will go look for the include files in that directory.