Unity3D Openfeint Xcode 4.1 C++编译为 C 的头文件
我正在尝试将 openfeint unity 插件集成到我们的游戏中, 我得到了 xCode 项目,按照 Openfeint 支持中的步骤操作Page 但是当尝试编译项目时,openfeint 的头文件被编译为 C 文件而不是 C++。
我几乎尝试了一切但没有成功。我添加了 -ObjC 构建标志, 和 GCC 设置中的 GCC_OBJC_CALL_CXX_CDTORS = YES 。
有什么想法出了什么问题吗? PS 我还从 Openfeint.h 收到错误消息:
#ifndef __cplusplus
#error "OpenFeint requires Objective-C++. In XCode, you can enable this by changing your file's extension to .mm" #endif
提前感谢
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 .
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您根本不应该将头文件视为编译目标。
您要么以某种方式标记要编译的头文件,要么将它们包含在 Objective-C 的 .m 文件中(与 Objective-C++ 的 .mm 文件相对)。假设是后者(这是更可能的情况),您可以简单地将受影响的 .m 文件重命名为 .mm。
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.