[C++-sig] Pyste suggestion: MSVC precompiled headers support

Niall Douglas s_sourceforge at nedprod.com
Thu Oct 9 02:57:34 CEST 2003

Hash: SHA1

On 8 Oct 2003 at 18:27, Nicodemus wrote:

> #include <boost/python.hpp>
> #include <boost/cstdint.hpp>
> #ifdef _MSC_VER
> #pragma hdrstop
> #endif
> #include <A.h>
> works for me. I thought that everything before #hdrstop would be
> *included* in the pre-compiled header, not excluded. But I don't see
> that happening, the code compiles fine.

Try generating a .pch file from some completely unrelated piece of 
code. Then try compiling the above using that pch file instead. You 
should get lots of errors.

Note that when you create a .pch file it still compiles whatever file 
you're doing - it just spits out the .pch file at the same time.

> >If you could always get pyste to start off with *exactly* the same 
> >#include's in the same order across all modules, then we don't need 
> >this feature. I had been assuming that the mechanism I proposed was
> >easier and better extensible for the future.
> >
> Well, this headers are included always first:
> <boost/python.hpp>
> <boost/cstdint.hpp>

Err, they're not here. The first include is always the one the 
Class() or AllFromHeader() has pulled in, which is invariably not 
global across all modules.

BTW is AllFromHeader() fixed yet?

> And I guess you could easily create a header, named "mylib.h", that
> includes everything else. So your pyste files would always just use
> this header to look for the classes/functions. Notice too that with
> the new --cache-dir option, GCCXML would be called only once for
> "mylib.h". With this, I guess using pre-compiled headers would be
> possible, right?

That causes extra recompiles. If I alter some header higher up, it 
means I must recompile ALL my modules instead of the one it actually 
affects. I'd prefer to avoid that please.


Version: idw's PGP-Frontend / 9-2003 + PGP 8.0.2


More information about the Cplusplus-sig mailing list