Author Topic: Precompiled headers in the codeblocks project?  (Read 6943 times)

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Precompiled headers in the codeblocks project?
« 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?

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Precompiled headers in the codeblocks project?
« Reply #1 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.
Be patient!
This bug will be fixed soon...

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Precompiled headers in the codeblocks project?
« Reply #2 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)

RShadow

  • Guest
Precompiled headers in the codeblocks project?
« Reply #3 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. :)

Chocoboko

  • Guest
Re: Precompiled headers in the codeblocks project?
« Reply #4 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.