Xcode 4 Final - “armv6 armv7”与armv6库链接时出现问题

发布于 2024-10-22 03:14:01 字数 861 浏览 1 评论 0原文

直到 xcode 4 Final(当时我使用的是 3.latest 和 4 GM),这种情况才发生。当我升级到 xcode 4 最终版本时,在尝试将armv7版本与我的非armv7库链接时开始出现链接错误(我的项目设置为默认的标准armv6 armv7有效架构):

ld: warning: ignoring file ../bin/iOS static/arm/libssl.a, file was built for archive which is not the architecture being linked (armv7)
ld: warning: ignoring file ../bin/iOS static/arm/libcrypto.a, file was built for archive which is not the architecture being linked (armv7)
Undefined symbols for architecture armv7: -- list of symbols --

armv6版本编译得很好,但是整个编译过程因 77 个链接错误而失败。

我知道这是预期的行为,它不会链接到带有armv6库的armv7。解决方法是将我的项目仅设置为armv6。我的问题是:为什么这在以前版本的 xcode 中有效?

如果我仅设置为armv6,我开始收到此警告:

Check dependencies

[BWARN]warning: all apps should include an armv7 architecture (current ARCHS = "armv6").

我不喜欢看到警告:-) 有人遇到类似问题吗?

谢谢,

费尔南多

Until xcode 4 final (I was using 3.latest and 4 GM for the time it was available) this didn't happen. When I upgraded to xcode 4 final version, I started getting a linking error while trying to link the armv7 version with my non armv7 library (my project is set with the default Standard armv6 armv7 valid architectures):

ld: warning: ignoring file ../bin/iOS static/arm/libssl.a, file was built for archive which is not the architecture being linked (armv7)
ld: warning: ignoring file ../bin/iOS static/arm/libcrypto.a, file was built for archive which is not the architecture being linked (armv7)
Undefined symbols for architecture armv7: -- list of symbols --

The armv6 version compiles just fine, but the overall compilation process fails with 77 link errors.

I understand this is the expected behavior, it wont link towards armv7 with an armv6 lib. The fix is setting my project to armv6 only. My question here is: why was this working in the previous versions of xcode?

If I set to armv6 only, I start to get this warning:

Check dependencies

[BWARN]warning: all apps should include an armv7 architecture (current ARCHS = "armv6").

I don't like seeing warnings :-) Anybody having similar issues?

Thanks,

Fernando

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(5

浅忆流年 2024-10-29 03:14:01

我刚刚将项目中的“构建活动架构”仅设置为“是”->构建设置->架构选项卡。

I just turned the Build active architecture only to Yes in the Project -> Build Setting -> Architectures tab.

青朷 2024-10-29 03:14:01

在 iOS SDK 4.3 中,链接器似乎会简单地拒绝在 armv7 二进制文件中使用 armv6 库 - 以前的情况并非如此。

这就是为什么我必须更新 http://code.google.com/p/ios -static-libraries/ 项目来生成armv6和armv7版本的库。

In iOS SDK 4.3, it looks like the linker will simply refuse to use a armv6 library in an armv7 binary - this wasn't the case before.

That's why I had to update the http://code.google.com/p/ios-static-libraries/ project to generate both armv6 and armv7 versions of the libraries.

-黛色若梦 2024-10-29 03:14:01

我已将带有一些演示类的第 3 方框架添加到项目中,但一旦成功实现,我删除了这些演示类,从那时起,错误开始出现
错误
“ld:……,文件是通用的,但不包含用于架构armv6的(n)armv6切片”

在挠头一整天后,我第二天早上发现这个解决方案可能对其他iphone伙伴有帮助因为我知道痛苦

目标->“你的项目目标”->获取信息 -> 构建活动架构仅设置为 YES

就是这样。

I have added 3rd Party framework with some demo classes into project but once implemented it successfully I removed those demo classes and since then the error started coming up
Error
"ld: ........., file is universal but does not contain a(n) armv6 slice for architecture armv6"

After scratching my head for a whole day I found this solution next morning maybe helpful for fellow iphone buddies coz I know the pain

Targets->"Your Project Target"-> Get Info ->Build Active Architecture only set to YES

Thats it..

一袭水袖舞倾城 2024-10-29 03:14:01

有同样的问题。
但我想原因是不同的。
我正在使用为模拟器构建的library.a 文件并尝试在设备上运行它..我发现我需要为模拟器和设备使用不同的.a 文件。我希望这对某人有帮助;)

Had the same problem.
But the reason was different I suppose.
I was using the library.a file built for simulator and trying to run it on device.. came to know that i need different .a files for simulator and device. I hope this helps someone ;)

旧人哭 2024-10-29 03:14:01

虽然我仍然不知道为什么这种情况只在 xcode 4 最终版本中开始发生,但我发现几天前我的外部库(ssl 和 crypto)是针对 google code 项目中的armv6和armv7进行编译的:

http://code.google.com/p/ios-static-libraries/

这个如果您定义两个不同的库搜索路径,将解决该问题:一个用于armv6,一个用于armv7。

谢谢,

Although I still don't know why this started happening only in the xcode 4 final version, I found that my external libs (ssl and crypto) were compiled against both armv6 and armv7 in the google code project very few days ago:

http://code.google.com/p/ios-static-libraries/

This will fix the issue if you define two different library search path: one for armv6, one for armv7.

Thanks,

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