c++ - 将源文件类型更改为 Objective-C++ 后的链接器错误

标签 c++ ios objective-c opengl-es-2.0

我有一个 OpenGL ES 2.0 应用程序,想在 View Controller 实现中使用 C++ 代码。但是,将文件扩展名更改为 mm 后(或者甚至只是调整源类型而不更改文件名),在链接过程中遇到以下错误:

架构 armv7 的 undefined symbol :

"_GLKMatrix4Identity", referenced from: GLKMatrix4MakeTranslation(float, float, float) in GameViewController.o
"_OBJC_METACLASS_$_GLKViewController", referenced from: _OBJC_METACLASS_$_GameViewController in GameViewController.o
"_OBJC_CLASS_$_GLKViewController", referenced from: _OBJC_CLASS_$_GameViewController in GameViewController.o
"_GLKMatrix3InvertAndTranspose", referenced from: -[GameViewController update] in GameViewController.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

欢迎提出任何建议。

最佳答案

我在构建阶段设置中手动添加了 GLKit 框架。 (虽然有趣的问题 - 为什么在不涉及 C++ 源时应用程序不需要它 - 它怎么可能编译和运行?)

关于c++ - 将源文件类型更改为 Objective-C++ 后的链接器错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27217728/

相关文章:

c++ - 使用 C++ 进行目录导航

ios - 我使用git_index_add_from_workdir添加,但是为什么git_index_entrycount返回0?

IOS 编码正文邮件(为 SES 创建我自己的 mime 邮件)

ios - 使用自动布局计算 tableHeaderView 高度

c++ - 无法获取已填充堆栈的顶部元素<char>

c++ - 如何在不使用 time_t 的情况下将 std::chrono::time_point 转换为 std::tm?

c++ - 如何将 HICON 保存为 .ico 文件?

ios - 如何将自动布局应用于 Xcode 中的一组项目?

iOS:如何通过按 UIButton 更改 UIImageView

iphone - 如何将 UIButton 传递给函数并在那里创建...?