Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
Bug Report: GCC -I- (Split include path) breaks some include chains
(1/1)
TDragon:
As of r1942 (I don't know how long it's been in place), the -I- option is being passed on the command line when precompiling a header in the object output dir. As noted here in the GCC manual, -I- inhibits the use of the directory of the current file directory as the first search directory for #include "file". This affects the include chains of popular libraries such as Allegro (where I first noticed it), such that any file in the chain whose directory is not in the list of include paths to search will not be found with a double-quoted #include directive.
This behavior is demonstrated by the attached project, in which the project SomeProject has a precompiled header which includes the main library header SomeLibrary.h. SomeLibrary.h includes SLAnotherHeader.h, which in turn tries to include SLYetAnotherHeader.h but fails. If the -I- command-line switch is removed, the command succeeds.
EDIT: Forgot to attach the file...oops
[attachment deleted by admin]
titan:
To remove the annoying -I- gcc compiler flag, try this workaround:
Project Options -> PCH Strategy -> "Generate PCH in a directory alongside original header"
If you use precompiled headers, this may affect your build in other ways. It's a workaround for now.
TDragon:
--- Quote from: TDragon on February 04, 2006, 11:53:49 pm ---..., the -I- option is being passed on the command line when precompiling a header in the object output dir.
--- End quote ---
I am indeed aware that the other PCH strategies don't use the -I- option, but the other PCH strategies also aren't as flexible.
Navigation
[0] Message Index
Go to full version