Hi,
I've problem using precompiled headers with CB nightly (10. october - 5859 svn). In stdafx.cpp file I've got only one line
#include "stdafx.h"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
#include <stdafx.h> 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:
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
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
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.
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.
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.
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
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
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.
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.
With default option ("Generate PCH alongside original header") everything is working right. It looks like it's mingw bug.
Trigve
Quote from: Trigve on October 23, 2009, 08:34:28 PM
With default option ("Generate PCH alongside original header") everything is working right. It looks like it's mingw bug.
I don't know what version you are using, but in a recent nightly this has been adjusted to work with more recent GCC's, too.
Quote from: MortenMacFly on October 23, 2009, 10:28:22 PM
I don't know what version you are using, but in a recent nightly this has been adjusted to work with more recent GCC's, too.
I'm using nightly from 10. October. And there it is not working apparently (or I'm doing something wrong).
Trigve
Quote from: Trigve on October 23, 2009, 11:02:27 PM
Quote from: MortenMacFly on October 23, 2009, 10:28:22 PM
I don't know what version you are using, but in a recent nightly this has been adjusted to work with more recent GCC's, too.
I'm using nightly from 10. October. And there it is not working apparently (or I'm doing something wrong).
Trigve
An related fix to stop an warning caused by GCC 4.x required an exe file to be the exact name it was expecting I think it wanted gcc.exe
If you do not have an file called what it wanted copy one to it; it used it to get the version of gcc.
Tim S.
Ok I've "fixed" it with moving header that need to be precompiled to separate dir.
Trigve