[Bug pch/13675] #including a precompiled header more than once in the same unit fails

rupert dot swarbrick at lineone dot net gcc-bugzilla@gcc.gnu.org
Sat Apr 1 23:19:00 GMT 2006



------- Comment #13 from rupert dot swarbrick at lineone dot net  2006-04-01 23:19 -------
(In reply to comment #11)
> The same problem stays unresolved in GCC-3.4.4  

As far as I can tell, the problem is STILL unresolved with g++ 4.1, but there
is a workaround for users that I post here for information.

Create a "proxy" header. e.g. if there is some PCH enabled "gtk_includes.hh",
create "gtk_includes_proxy.hh", which is not precompiled and just has the
contents:
#ifndef GTK_INCLUDES_PROXY_HEADER
#define GTK_INCLUDES_PROXY_HEADER
#include "gtk_includes.hh"
#endif

This will ensure that the actual precompiled header is only included once per
module.


-- 

rupert dot swarbrick at lineone dot net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rupert dot swarbrick at
                   |                            |lineone dot net


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13675



More information about the Gcc-bugs mailing list