Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: Swiftslide on August 17, 2010, 05:31:22 am

Title: #include statments don't point to the right directory
Post by: Swiftslide on August 17, 2010, 05:31:22 am
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?
Title: Re: #include statments don't point to the right directory
Post by: killerbot on August 17, 2010, 07:35:24 am
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.