在 iPad 2 上编译 ObjectiveC hello world

发布于 2024-12-18 02:43:13 字数 548 浏览 5 评论 0原文

我正在尝试在越狱的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

生来就爱笑 2024-12-25 02:43:13

您必须从 /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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文