Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: rickg22 on July 12, 2005, 06:44:32 pm

Title: Precompiled headers in the codeblocks project?
Post by: rickg22 on July 12, 2005, 06:44:32 pm
http://tools.devchannel.org/devtoolschannel/03/11/26/2218209.shtml?tid=24&tid=46

Does anyone know how to optimize the C::B compilation by using precompiled headers?

I'm tired of having to wait 10 minutes for each rebuild.

[Edit]

According to what I have read, every .h file you include can be precompiled, as long as no C (or C++) tokens are used before. So I was wondering if we could "transparently" support precompiled headers (GCC 3.4+ required) by adding them in the dependencies directory. If a header used by another header is modified, then delete the corresponding .gch file.

But I'm not exactly sure, I haven't ever used precompiled headers and i'm just learning the basics. Any expert in here?
Title: Precompiled headers in the codeblocks project?
Post by: mandrav on July 12, 2005, 07:19:27 pm
Tried to do that but it seems precompiled headers are a bit flakey, at least with gcc 3.4.2.
I can't recall the exact error message but was something like "fdopen: error opening file" or something. A little research showed that this is a bug of gcc-3.4.x when a file (#including a pre-compiled header) #includes a file which includes a pre-compiled header, or something. The funny thing is that C::B sdk build stopped with errors after compiling a dozen files, not immediately...

If anyone knows better about the subject, please enlighten us :)

Yiannis.
Title: Precompiled headers in the codeblocks project?
Post by: tiwag on July 12, 2005, 08:01:02 pm
if you want to have **FAST** compiling and linking, you should build project-files for DigitalMarsCompiler or M$-VCTK (or VS)
Title: Precompiled headers in the codeblocks project?
Post by: RShadow on July 13, 2005, 12:18:19 am
Quote from: mandrav
Tried to do that but it seems precompiled headers are a bit flakey, at least with gcc 3.4.2.
I can't recall the exact error message but was something like "fdopen: error opening file" or something. A little research showed that this is a bug of gcc-3.4.x when a file (#including a pre-compiled header) #includes a file which includes a pre-compiled header, or something. The funny thing is that C::B sdk build stopped with errors after compiling a dozen files, not immediately...

If anyone knows better about the subject, please enlighten us :)

Yiannis.


Once the Scon's build scripts are completed they will allow PCH transparantly... assuming the compiler being used supports PCH... and as Yiannis said.. PCH and GCC is currently flakey.. but at least the option will be there for users that want to experiment with it. :)
Title: Re: Precompiled headers in the codeblocks project?
Post by: Chocoboko on July 28, 2005, 09:33:44 am
This feature definitely sounds nice, when it works much better.

I certainly think the Standard Template Library would do well as a precompiled header.