help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: precompiled headers and -E


From: Paul Pluzhnikov
Subject: Re: precompiled headers and -E
Date: Thu, 08 Sep 2005 21:35:55 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Jumbo Shrimp, linux)

"Greg" <greg.szeszko@tradingtechnologies.com> writes:

> Is there a way to tell g++ to use precompiled headers even if the -E
> options is specified?

>From 'info gcc' (for gcc-4.1-20050813):

`-fpch-preprocess'
     This option allows use of a precompiled header (*note Precompiled
     Headers::) together with `-E'.  It inserts a special `#pragma',
     `#pragma GCC pch_preprocess "<filename>"' in the output to mark
     the place where the precompiled header was found, and its
     filename.  When `-fpreprocessed' is in use, GCC recognizes this
     `#pragma' and loads the PCH.

     This option is off by default, because the resulting preprocessed
     output is only really suitable as input to GCC.  It is switched on
     by `-save-temps'.

     You should not write this `#pragma' in your own code, but it is
     safe to edit the filename if the PCH file is available in a
     different location.  The filename may be absolute or it may be
     relative to GCC's current directory.

However, if your remote host does not have access to the .pch
file(s), this will still be useless. 

For that case, you'll need a separate special flag which will send
your .pch file(s) encoded in-band as output from 'g++ -E'. Since
.pch files are usually quite large, this may prove to be a waste --
you could spend more time sending .pch to the remote host than you
would have spent compiling locally.

Cheers,
-- 
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]