views:

422

answers:

1

Hi, I downloaded OpenFeint version 2.3.1, unzipped and placed the OpenFeint folder inside right underneath my project in Xcode, and checked "recursively create groups if needed" (the instructions said to use groups and not a folder reference). I renamed my AppViewController and AppDelegate .m files to .mm. I followed the rest of the instructions and compiled and ran, the app works fine. Inside AppViewController.mm I do:

#import "OpeinFeint.h"

and compile, which gives me the errors:

#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'

and the location of the errors takes me to the OpenFeint files. I did add -ObjC to Other Linker Flags and check Call C++ Default Ctors/Dtors in Objective-C. Any advice? Thanks!

A: 

The linker flag should be -lobjc, not -ObjC.

Chuck
-ObjC is the correct linker flag for Objective-C, not -lobjc.
Jasarien
@Jasarien: Documentation reference? Because I have this: http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Link-Options.html#index-lobjc-891
Chuck
Thanks, I switched the linker flag, then I had to change the file type to sourcecode.cpp.objcpp - just renaming it wasn't enough. Compiles ok now, thanks!
quantumpotato
Which file type you changed?
tt.Kilew
the viewcontroller.m and appdelegate.m to .mm
quantumpotato