armv6和armv7的条件编译

sil*_*ric 9 xcode compiler-errors armv7 armv6 ios

我有一个已发布的应用程序,它同时支持amrv6和armv7.现在我有一个仅与armv7兼容的升级(我添加了一个依赖于armv7的外部库).当我尝试将应用程序提交到商店时,我会收到详细信息

我理解上一个错误,我需要更改我的应用程序,以便它支持这两种体系结构.我的问题是我的代码依赖于一个只与armv7兼容的库.如果我更改项目的属性以支持armv6和armv7,我会收到编译错误(详情如下).我需要能够编译支持这两种体系结构的代码:使用我依赖于armv6的库的armv7编译有一个不依赖于库的不同代码.

我怎样才能做到这一点?

错误详情:

• the compile crash is in one Lib file (.a) and the error says : ld: warning: directory not found for option '-L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/usr/lib/gcc/arm-apple-darwin10/4.0.1' ld: in /Users/.../(lib file).a, file is universal but does not contain a(n) armv6 slice for architecture armv6 Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-gcc-4.2 failed with exit code 1

提前致谢

sil*_*ric 4

好吧,我意识到我的最后一个答案不是正确的...苹果说这是不可能的,但这不是真的...感谢吉姆,我搜索了更多,我找到了一种方法来做到这一点..

  1. 从“构建阶段”中删除 lib
  2. 在“其他链接器标志”(构建设置)中添加两种架构,为此您需要单击+并添加armv6和armv7
  3. 在armv7..中添加lib-l
  4. 不要忘记#if defined _ARM_ARCH_7在你的代码中

这就像吉姆的回答,但更详细。