User forums > Using Code::Blocks

Including header files

(1/1)

LordCB:
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"
--- End code ---

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|

--- End code ---

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" />

--- End code ---

stahta01:
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.

LordCB:
Adding the projectfolder do the trick?!?!?!

When I have a project open, why should I add the the Projectpath to itself.???

MortenMacFly:

--- Quote from: LordCB on March 05, 2010, 04:44:34 pm ---When I have a project open, why should I add the the Projectpath to itself.???

--- End quote ---
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.

LordCB:
Ok thanx a lot ;o)

Navigation

[0] Message Index

Go to full version