AppViewController和Delegate扩展名更改为.mm,#import“OpenFeint.h”给出了OpenFeint需要的错误Obj-C ++

时间:2009-12-22 21:11:34

标签: iphone objective-c xcode openfeint

我下载了OpenFeint版本2.3.1,解压缩并将OpenFeint文件夹放在Xcode中我项目的正下方,并检查“如果需要递归创建组”(说明使用组而不是文件夹引用)。 我将我的AppViewController和AppDelegate .m文件重命名为.mm。我按照其余的说明编译并运行,该应用程序工作正常。 在AppViewController.mm里面我做:

#import "OpeinFeint.h"

并编译,这给了我错误:

#error: "OpenFeint requires Objective-C++. In Xcode, you can enable this by changing your file's extension to .mm".
#error: syntax error before 'OfNotificationCategory'
#error: syntax error before 'OfNotificationCategory'

并且错误的位置将我带到OpenFeint文件。 我确实将-ObjC添加到Other Linker Flags并检查Objective-C中的Call C ++ Default Ctors / Dtors。 有什么建议?谢谢!

1 个答案:

答案 0 :(得分:-1)

链接器标志应为-lobjc,而不是-ObjC。