Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: LordCB on March 05, 2010, 04:12:14 pm

Title: Including header files
Post by: LordCB on March 05, 2010, 04:12:14 pm
Hello Friends,

I have a stranges problem. During coding I add a  class with header and implementation.
So the headerfile in folder "header" and the implementation in the "src" folder.

So my include for the header looks like
Code
#include "header/project.h"

and then... compilation
I get this
Code
X:\path\to\my\project\src\project.cpp|32|error: header/project.h: No such file or directory|

what wrong here? I look in the cbp file and the files are correct placed in my oppinion

Code
		<Unit filename="header\project.h" />
<Unit filename="header\stringtable.h" />
<Unit filename="header\tokenizer.h" />
Title: Re: Including header files
Post by: stahta01 on March 05, 2010, 04:16:48 pm
Add an search directory for the current project folder or the "src" folder.
Or, check mark the the place in project settings where it does that.

Tim S.
Title: Re: Including header files
Post by: LordCB on March 05, 2010, 04:44:34 pm
Adding the projectfolder do the trick?!?!?!

When I have a project open, why should I add the the Projectpath to itself.???
Title: Re: Including header files
Post by: MortenMacFly on March 05, 2010, 04:51:06 pm
When I have a project open, why should I add the the Projectpath to itself.???
Because your project file can be anywhere.
It's probably misleading, but it's not the project path that you have to add, but the path where "header" is the sub-path. In your case it's most likely the project path.
Title: Re: Including header files
Post by: LordCB on March 05, 2010, 09:13:46 pm
Ok thanx a lot ;o)