In my current project I have separated my class files and my header files. My project structure currently looks like this:
Project
Assuming you want class1.cpp to include class1.h you would do something like this
#include "../../Header/class1.h"
The ..
tells the tells the OS to jump 1 directory up when the compiler asks for the file.
I had a very similar problem where my compiler could not find the header with a code::blocks C++ project (same file structure as OP) .
This worked for me:
#include "../include/class1.h"
You need to indicate the include path <the directory containing Project>
to your compiler so that the compiler is able to find the included headers. Using gcc, you could use -I
option, and using visual studio, you could use /I
.