Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

include header files in different directories

(1/1)

wzyjy:
This may be a stupid question:

I have a big folder(say source_root) containing .cc files and .h files in many different sub-folders. When I tried to build the whole project, say 1.cc in subfolder A wants to include b.h in subfolder B, it just could not find file b.h.

Is there anyway to solve this issue?
I tried to add source_root into additional search path (under the project properties->C/C++ parser options), but it didn't work...

Jenna:
Add all folders, that contain headers you want to include (except for system standard folders) to "Project -> Build options... -> [your project _not_ the targets] -> Search directories -> Compiler"

wzyjy:
Thanks, I already did that and it worked.
The only thing is I have to add all the sub-folders manually, is there any way to do it recursively? (If I have 100+ sub-folders, do I have to add them all manually?)

stahta01:
Try doing

Settings -> "Compiler And Debugger" [SELECT YOUR COMPILER]
Tab "Other Settings] Check mark "Explicitly add Currently Compiling File's Directory to Compiler search path"
This should reduce the number of paths to add.

Tim S.

Navigation

[0] Message Index

Go to full version