Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
About PCH settings
(1/1)
lfm:
I tested a simple application, settings in "project->properties->Project->Precompiled headers", when i select "Generate PCH in a directory alongside original header" (this is default), it will be compiled succesfully; But when i select "Generate PCH in the object output dir (default)", it will be compiled with a error: "no such file or directory".
Please see the follows project file:
[attachment deleted by admin]
MortenMacFly:
...did you realise that it is working if you add "in1" to the compiler directories for this project?
With regards, Morten.
lfm:
--- Quote from: MortenMacFly on June 01, 2006, 09:13:23 am ---...did you realise that it is working if you add "in1" to the compiler directories for this project?
With regards, Morten.
--- End quote ---
Of course, copiled successfuly if add "in1".
I modified the project file, please download and test again.
MortenMacFly:
For the new project you'll have to add the ..\include\in1 folder, too.
I'm not sure I get what you think the issue shall be. The compiler does exactly what you want. In the second case the compiler command line (without adding ..\include\in1) is:
--- Code: ---mingw32-g++.exe -I- -I. -I..\include -ID:\Devel\GCC345\include -c main.cpp -o .objs\main.o
--- End code ---
Using the "generat PCH in the object output dir" enables the "-I-" compiler switch. If you read what's said about the "-I-" switch it makes perfect sense that the compiler complains about "../in0.h: No such file or directory":
--- Code: --- -I- Split the include path. Any directories specified with -I options before -I-
are searched only for headers requested with "#include "file""; they are not
searched for "#include <file>". If additional directories are specified with -I
options after the -I-, those directories are searched for all #include directives.
In addition, -I- inhibits the use of the directory of the current file directory as
the first search directory for "#include "file"".
--- End code ---
This means that you have to explicetly add all header include folders after the "-I-" switch (in the compiler options of your project). If you do that it'll compile just fine.
With regards, Morten.
lfm:
--- Quote from: MortenMacFly on June 01, 2006, 09:56:32 am ---This means that you have to explicetly add all header include folders after the "-I-" switch (in the compiler options of your project). If you do that it'll compile just fine.
With regards, Morten.
--- End quote ---
Thank you !
Navigation
[0] Message Index
Go to full version