在 iPad 2 上编译 ObjectiveC hello world
我正在尝试在越狱的 iPad 2 上编译 ObjectiveC hello world。gcc
已经可以在我的 iPad 上运行 c/c++ 了。我毫无问题地构建了 OpenEXR。 我从 iPhoneOS 4.2 SDK 复制了框架 headers/lib 并安装了“iPhone 2.0 Toolchain”。
使用命令:
gcc -I/private/var/include -framework Foundation hello.m
我遇到了两种错误:
ld warning: bad symbol version: $ld$add$os3.2$_OBJC_METACLASS_$_NSURL in dylib /System/Library/Frameworks//Foundation.framework/Foundation
ld: file not found: /usr/lib/libobjc.A.dylib
在哪里可以找到文件“libobjc.A.dylib”或者我在工具链中缺少任何内容吗?
I'm trying to compile a ObjectiveC hello world on a jailbroken iPad 2.
The gcc already works for c/c++ on my iPad. I got OpenEXR built without problems.
I copied framework headers/lib from iPhoneOS 4.2 SDK and installed "iPhone 2.0 Toolchain".
With the command:
gcc -I/private/var/include -framework Foundation hello.m
I got 2 kinds of errors:
ld warning: bad symbol version: $ld$add$os3.2$_OBJC_METACLASS_$_NSURL in dylib /System/Library/Frameworks//Foundation.framework/Foundation
ld: file not found: /usr/lib/libobjc.A.dylib
Where I can find the file "libobjc.A.dylib" or am I missing anything in the toolchain?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须从 /var/sdk/usr/lib 找到丢失的库,并将其复制或符号链接到所需的路径。当您混合使用“cydia”工具箱和 SDK 时要小心,因为您可能不会得到您所期望的结果(通常会出现很多警告和更多符号链接库)。
这是因为工具(主要是 ld)认为您正在使用 2.0 工具链,并对稍后介绍的方法发出警告。
You have to find the missing lib from /var/sdk/usr/lib and copy or symlink it over the required path. Beware when you mix the "cydia" toolcahin and an SDK as you might not get what you expected (usually, a lot of warning and more libs to symlink).
This is because the tools (mostly ld) think that you're using the 2.0 toolchain and warn for methods which have been introduced later.