Unity3D Openfeint Xcode 4.1 C++ headers compiled as C
I am trying to integrate the openfeint unity plugin into our game, I got the xCode project, followed the steps from Openfeint Support Page but when trying to compile the proiect openfeint's header files are compiled as C files not as C++.
I tried almost everything without cuccess. I added the -ObjC build flag, and GCC_OBJC_CALL_CXX_CDTORS = YES in the setting of GCC .开发者_如何学C
Any ideas what went wrong? P.S. I also get the error message from Openfeint.h:
#ifndef __cplusplus
#error "OpenFeint requires Objective-C++. In XCode, you can enable this by changing your file's extension to .mm" #endif
Thanks in advance
You shouldn't treat header files as compilation targets at all.
Either you are somehow marking header files for compilation, or including them in .m files, which are Objective-C (as opposed to .mm files, which are Objective-C++). Assuming the latter — which is the more likely scenario — you can simply rename the affected .m files to .mm.
精彩评论