我有一个OpenGL ES 2.0应用程序,并希望在视图控制器实现中使用C ++代码。但是,在将文件扩展名更改为mm(或者甚至只是调整源类型而不更改文件名)后,在链接期间会遇到以下错误:
架构armv7的未定义符号:
“_ GLKMatrix4Identity”,引自: GameViewController.o中的GLKMatrix4MakeTranslation(float,float,float) “_OBJC_METACLASS _ $ _ GLKViewController”,引自: GameViewController.o中的_OBJC_METACLASS _ $ _ GameViewController “_OBJC_CLASS _ $ _ GLKViewController”,引自: GameViewController.o中的_OBJC_CLASS _ $ _ GameViewController “_GLKMatrix3InvertAndTranspose”,引自: - GameViewController.o中的[GameViewController更新] ld:未找到架构armv7的符号
clang:错误:链接器命令失败,退出代码为1(使用-v查看调用)
欢迎任何建议。
答案 0 :(得分:3)
我在构建阶段设置中手动添加了GLKit框架。 (虽然有趣的问题 - 为什么当没有涉及C ++源时应用程序不需要它 - 它怎么可能编译并运行?)