User forums > Help

Recursive Include Directories

(1/2) > >>

Wavesonics:
I have a project with a rather deep directory structure, and I want to be able to be able to set the top directory as an include directory for the compiler and have it be recursive, so all the sub directories are checked for header includes as well.

Is there any way of doing this?

stahta01:
This is a compiler question, no one can answer your question without knowing the compiler.
I don't know of any compiler that does what you want be I don't know very many compilers.

Tim S

Wavesonics:
Yes i know it's a compiler issue, I'm using gcc, g++ specifically. But I was woundering if maybe Code Blocks had a nice little feature to be intelegent and add all the sub directories as paths as well.

Maybe I should put this in feature request...

stahta01:
Look at "settings" -> "Compiler and Debugger"
Under tab "Other"
Has options to add file being compiled directory and top level directory options.
It is NOT want you asked for but it all that I know that codeblocks does.

Note: You do know about "project" -> "Build options" "directories" -> "compiler" Tab this is the normal place to add include search directories. If you do NOT know about that please try it first.

Note: You can add each directory one at a time manually. I think compiler other options not sure on that.
I was thinking to add these folders "..", "../..", "../../.." that may solve your problem, note I would never do it because I like knowing exactly what folders are being searched.

Tim S

MortenMacFly:

--- Quote from: Wavesonics on December 14, 2006, 02:26:28 am ---if maybe Code Blocks had a nice little feature to be intelegent and add all the sub directories as paths as well.

--- End quote ---
This wouldn't be intelligent at all. Imagine you have a header that appears twice - doing such "magic" you are proposing here would be very error prone.
The best and cleanest way is to really think about what folders you need to include and include them manually. The good thing about that: You do need to do it once only. And if you start a new project - just do it as this from the very beginning and you won't come in such a situation ever.
With regards, Morten.

Navigation

[0] Message Index

[#] Next page

Go to full version