pch support

Rolf Kalbermatter rolf.kalbermatter at citeng.com
Thu Jan 12 02:30:28 CST 2006

Steven Edwards wrote:

> Alexandre did not like the needed changes required to add support for
> this but I figured I would throw it out for debate anyway in case
> anyone else can make him change his mind (duck). The issue is he does
> not like needing a single header per-program or per dll. After doing
> some research it seems to me that even MSVC does not support multiple
> PCH files per project so I don't know how it could be fixed in gcc to
> do it Microsoft has not figured it out.

Well, having a single header file to include indeed looks not nice. This
would grow and grow as more modules are added and eventually you would be
adding the entire SDK headers to every source file indirectly. It is also
not the way MSVC does do it. Instead the preparser or something seems to
create a separate pch file from all the specifically included headers in
that project and it seems smart enough to allow for different headers in
different source files that can conflict if used together. I'm not sure
how you would suppose to avoid possible conflicts of headers in this way.
Maybe you consider maintaining one single precompile.h file per module but
that's one more file to maintain and it still won't solve the issue of
Conflicting header files used in different source files inside that module.

The Wine/MS SDK/crt headers are already a nightmare to combine sometimes and
your single header would only increase that issue. And Wine attempting to be
compilable on many different systems besides standard Linux, has certainly
a lot more possible difficulties with header conflicts than most other

> problem:
> ccache works great for speeding up compiles but seems to still have
> issue with some header changes. Also the ReactOS guys really want to
> add pch support to the Wine dlls that are shared so the job falls to
> me to sell it to Wine.

I've had issues with header changes with MSVC precompiled headers too.
Sometimes the only solution is to disable precompiled headers and delete
the pch file. For fairness I have to say that I'm still using MSVC 6 so
there is a good chance that more recent MSVC systems have better dependency
tracking in precompiled headers.

Rolf Kalbermatter

More information about the wine-devel mailing list