Objective-C++ pre-compiled headers
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.
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
精彩评论