GCC & precompiled headers question

Christoph Höger choeger at cs.tu-berlin.de
Sun May 9 21:03:50 UTC 2010


Am Sonntag, den 09.05.2010, 04:25 +0200 schrieb Kevin Kofler:
> Christoph Höger wrote:
> > Unfortunately g++ also allows one single precompiled header per
> > compilation unit. Does anyone know why?
> 
> Because a g++ "precompiled header" is more or less a dump of the complete 
> compiler state, which is loaded and from which compilation continues. 
> Obviously this can only work for a single header included before any non-
> comment non-whitespace line.

Ah, nice to know. Thanks.

> > And is there any way to speed up the "linking" process a little (like
> > letting g++ at least preprocess the headers or something like this)?
> 
> Create a header like "all.h" which includes all the headers you actually 
> want to include and precompile that one.

Yeah. Nice Idea, but creating n! headers is not very ... scalable. And
of course  clients are not going to use only one single library.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
Url : http://lists.fedoraproject.org/pipermail/devel/attachments/20100509/4c2f946b/attachment-0001.bin 


More information about the devel mailing list