views:

29

answers:

1

I'm using a C++ library (it happens to be in an iPad application, but I'm not sure that should make any difference) and would really like to have the headers pre-compiled to speed up the builds, but xCode seems to run the pre-compiled header file through the C compiler rather than the C++ one.

Is there a way to get it to use the right compiler? I've already changed all of my source files from .m to .mm.

+1  A: 

According to the Xcode docs, a compiled header is generated for each language variant. So if you bracket your #include with guard macros, it should work i.e.

#if defined __cplusplus
#include "mycplusplusheader.h"
#endif
JeremyP
That's the ticket :)
KayEss