我如何为armv6,armv7和i386编译静态库(fat) [英] How do i compile a static library (fat) for armv6, armv7 and i386

查看:355
本文介绍了我如何为armv6,armv7和i386编译静态库(fat)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这个问题已多次提出,但我的目标与我在网上搜索的内容略有不同。具体来说,我已经能够为iPhone构建一个静态库,但我能够构建的最终胖文件只包含arm和i386架构(我不确定arm指的是什么:是v6还是v7?)。我无法专门为armv6和armv7编译,他们使用lipo合并两个架构。 lipo工具抱怨armv6和armv7库中都存在相同的架构(arm,而不是armv6或armv7)。

I know this question has been posed several times, but my goal is slightly different with regard to what I have found searching the web. Specifically, I am already able to build a static library for iPhone, but the final fat file I am able to build only contains arm and i386 architectures (and I am not sure to what arm refers: is v6 or v7?). I am not able to compile specifically for armv6 and armv7 and them merge both architectures using lipo. The lipo tool complains that the same architecture (arm, not armv6 or armv7) is present in both the armv6 and armv7 libraries.

有人可以解释如何构建armv6和armv7,他们使用lipo将这些库合并到一个胖文件中?

Can someone explain exactly how to build for armv6 and armv7, and them merge these libraries into a fat file using lipo?

编辑:我需要构建不使用Xcode但直接编译传统的unix库。

EDIT: I need to build not using Xcode but compiling directly a traditional unix library.

推荐答案

只需使用libtool将两个arm6和arm7版本链接在一起 - 这就是XCode的作用。但是,如果您尝试将这些静态库组合到新的超级库中,则会遇到问题。如果您需要这样做,请阅读

Just use libtool to link the two arm6 and arm7 versions together - its what XCode does. However you will have problems if you try to combine these static libraries into a new super-library. If you need to do that then read this.

如果你已经这样做了,那就是为什么lipo抱怨你的armv6库同时包含armv6和armv7。我的帖子有一个修复,因为你不使用XCode可能会更容易,但基本上你使用lipo -extract来确保你有一个瘦armv6库和一个瘦armv7库,然后再继续。

If you are doing this already, that would be why lipo is complaining that your "armv6" library contains both armv6 and armv7. My post has a fix that will probably be easier for you since you don't use XCode, but basically you use lipo -extract to make sure you have a thin armv6 library and a thin armv7 library before you go any further.

这篇关于我如何为armv6,armv7和i386编译静态库(fat)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆