I am using Code::Blocks as my IDE and I am creating a text based game (Not very complex as I am just starting out with c++). As I proceed through this project I have found it more orderly to have multiple cpp files within a folder that relate(like two cpp files will have all of one header).

header HEADER - 
void goesInAFile();
void goesInAnotherFile();    

HEADER

OneCPPFile
void goesInAFile() {}

First cpp file

SecondCPPFile
void goesInAnotherFile() {}

Second cpp file

and OneCPPFile and SecondCPPfile go into a sub folder.
so its like

PROJ
-FILES
--header HEADER
--HEADER CPP FILES
---OneCPPFile
---SecondCPPFile

Edited 4 Years Ago by majorawsome

majorawsome
Deleted Member

in my IDe i have 2 files in a seperate folder but they wont let me acccess the folder above it where the header is.
Sorry I was rushed to get the example of what it lookes like out i forgot to put my problem in the main statement. lol

I was able to find the answer. If you want to create a project with multiple folders and you want to have other headers access them just use
#include "../HEADER.H"

With this the two ".." before the / means to go up one folder.
If you are still confused please see here
http://stackoverflow.com/questions/5134357/how-to-include-header-files-in-other-src-folder
It is the first answer. I also believe that this explains it better than I did here so see this example.

This question has already been answered. Start a new discussion instead.