So, I am using Xcode 6.1 in my Objective-C application. My application uses the GameKit framework.
I tried calling external C ++ methods from my GameViewController (which is the Objective-C source.)
In order to compile GameViewController.mm, I had to set the type 'Objective-C ++ Source' manually.
However, even if the source code is now compiled, it will not be able to reference:
Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_GLKViewController", referenced from: _OBJC_CLASS_$_GameViewController in GameViewController.o "_OBJC_METACLASS_$_GLKViewController", referenced from: _OBJC_METACLASS_$_GameViewController in GameViewController.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
I can get rid of the linker error by setting the type back to 'Objective-C Source' and removing calls to external C ++ functions.
Why does the linker not work if my source is compiled as 'Objective-C ++ Source' instead of 'Objective-C Source' type?
Please note that I am correctly attached to GameKit at the build stages.
source share