User forums > Help

Precompiled headers and -iquote

(1/2) > >>

Trigve:
Hi,
I've problem using precompiled headers with CB nightly (10. october - 5859 svn). In stdafx.cpp file I've got only one line

--- Code: ---#include "stdafx.h"
--- End code ---
stdafx.h is header that should be precompiled. When I build precompiled header and then compile stdafx.cpp, the precompiled header isn't use. I've tried it with inserting dummy stdafx.h with #error and put it to object output dir and compile the stdafx.cpp WITHOUT stdafx.h.gch and no error is raised. So evidently the object output dir isn't searched for includes. However -iquote is used. Anyway if I use

--- Code: ---#include <stdafx.h>
--- End code ---
precompiled headers are taken into care (of course as the local dir is searched after the "-I" dirs). Here is command line when building stdafx.cpp:

--- Code: ---mingw32-g++.exe  -g -W -O0 -DWIN32 -D_DEBUG -D_WINDOWS -D_USRDLL -DUTILS_EXPORTS -DLIBXML_STATIC  -Winit-self -Wcast-align -Wundef -Winline -Wmissing-declarations -Wmissing-include-dirs -Wmain   -iquoteDebug\src -IDebug\src -I. -ID:\work\Other\Xml\libxml2-2.7.3\include -ID:\work\Other\Utils\boost_1_40_0  -c D:\work\xxx\xxx\branches\gcc\xxx\src\stdafx.cpp -o Debug\src\stdafx.o

--- End code ---

In project properties I've checked "Generate PCH in the object output dir" option. I'm using mingw 4.4.1-tdm-2

Thanks

Trigve

stahta01:
Suggest you look at how the Code::Blocks project does precompiles in the src target.

MinGW GCC is used and it is NOT done the way you are trying.

Look at the properties of the sdk.h file it is marked to be compiled.

Tim S.

Trigve:
Thanks for reply,

--- Quote from: stahta01 on October 23, 2009, 05:22:13 pm ---Suggest you look at how the Code::Blocks project does precompiles in the src target.

MinGW GCC is used and it is NOT done the way you are trying.

--- End quote ---

What do you mean by that? I've looked at CB project files and haven't found anything special there.


--- Quote from: stahta01 on October 23, 2009, 05:22:13 pm ---Look at the properties of the sdk.h file it is marked to be compiled.

--- End quote ---

I have the "same" properties set on my header file that should be precompiled. Maybe if you could be more precise about what need to be adjusted it'll be great.

Thanks

Trigve

stahta01:

--- Quote from: Trigve on October 23, 2009, 04:43:31 pm ---
In project properties I've checked "Generate PCH in the object output dir" option. I'm using mingw 4.4.1-tdm-2

Thanks

Trigve

--- End quote ---

Sorry about my prior post I thought stdafx.h.gch was not being created.

Have you tried the other two "Generate PCH" options one of them was broken when gcc 4.x came out; but, I thought that was fixed in the nightly a year or so ago.

Tim S.

Trigve:

--- Quote from: stahta01 on October 23, 2009, 07:06:48 pm ---Sorry about my prior post I thought stdafx.h.gch was not being created.

Have you tried the other two "Generate PCH" options one of them was broken when gcc 4.x came out; but, I thought that was fixed in the nightly a year or so ago.

Tim S.

--- End quote ---

With default option ("Generate PCH alongside original header") everything is working right. It looks like it's mingw bug.

Trigve

Navigation

[0] Message Index

[#] Next page

Go to full version