Can folders be added to a C++project??

I am writing a program that has many header files and their corresponding implementation files. I collected all the header files in a folder and did same for the implementation files into another folder. I'm using the Dev C++ IDE; I could add the files one by one to the project. Instead of doing this however, I tried adding the two folders to the project; but, the project did not compile!! The compiler could not find the files resident in each of the folders!

Does anyone know how I can add the folders to the project so that the internal files are visible to the compiler; or do I have to go the longer route of adding the internal files individually??
Last edited on
Long route it is I'm afraid. The linker is just as dumb as any other component of the computer and it will only do exactly what you tell it to. You can add the folder to the default search path on the project to save some typing but you have to name the files you want included individually.
If you have something like this as your hierarchy

1
2
3
    project
      / \
headers implementations


instead of all of them inside of project you will have to do something like:

 
#include "../headers/someheader.hpp" 


the ../ moves the directory up one level so it will go from project/implementations to project then from there you will need to go down to your headers.
Last edited on
./ is the current directory, whereas ../ is the parent directory.
I would just CTRL+A and drag all files in that folder into the IDE. Works in visual studio. Sometimes I like to add Filters in VS to my projects and that's a way of organizing my sources and headers.
Topic archived. No new replies allowed.