1

我已经成功地在 armv6 和 armv7 上为 iPhone/iPad 构建了 boost c++ 1_44_0 库,但我似乎无法为在 armv7s 上运行的较新设备创建构建。

在 Github 上使用 BoostOnIphone 和 A-coding 来创建构建,我只需要 Boost:armv7s 架构上的线程、文件系统和系统库。

错误输出:

ld: warning: ignoring file /Users/shams/Documents/Sources/Hawk.framework/Release-iphonesimulator/libhawk-engine.a, file was built for archive which is not the architecture being linked (armv7s): /Users/shams/Documents/Sources/Hawk.framework/Release-iphonesimulator/libhawk-engine.ald: warning: 
ld: warning: ignoring file /Users/shams/Documents/Sources/Hawk.framework/Release-iphoneos/libhawk-engine.a, file was built for archive which is not the architecture being linked (armv7s): /Users/shams/Documents/Sources/Hawk.framework/Release-iphoneos/libhawk-engine.ald: warning: ignoring file /Users/shams/Documents/Sources/boost.framework/Release-iphonesimulator/libboost_filesystem.a, file was built for archive which is not the architecture being linked (armv7s): /Users/shams/Documents/Sources/boost.framework/Release-iphonesimulator/libboost_filesystem.a
ignoring file /Users/shams/Documents/Sources/boost.framework/Release-iphonesimulator/libboost_system.a, file was built for archive which is not the architecture being linked (armv7s): /Users/shams/Documents/Sources/boost.framework/Release-iphonesimulator/libboost_system.a

ld: warning: 
ld: warning: ignoring file /Users/shams/Documents/Sources/boost.framework/Release-iphonesimulator/libboost_thread.a, file was built for archive which is not the architecture being linked (armv7s): /Users/shams/Documents/Sources/boost.framework/Release-iphonesimulator/libboost_thread.ald: warning: ignoring file /Users/shams/Downloads/boostoniphone-master/build/armv7/libboost_filesystem.a, file was built for archive which is not the architecture being linked (armv7s): /Users/shams/Downloads/boostoniphone-master/build/armv7/libboost_filesystem.a

ignoring file /Users/shams/Downloads/boostoniphone-master/build/armv7/libboost_system.a, file was built for archive which is not the architecture being linked (armv7s): /Users/shams/Downloads/boostoniphone-master/build/armv7/libboost_system.a
ld: warning: 

ignoring file /Users/shams/Downloads/boostoniphone-master/build/armv7/libboost_thread.a, file was built for archive which is not the architecture being linked (armv7s): /Users/shams/Downloads/boostoniphone-master/build/armv7/libboost_thread.a
Undefined symbols for architecture armv7s:
4

1 回答 1

0

我的解决方案是使用终端验证库架构:

otool -h libraryFile.a

输出:

Mach header
      magic cputype cpusubtype  caps    filetype ncmds sizeofcmds      flags
 0xfeedface      12          9  0x00          1     3       1588 0x00002000

cputype 和 cpusubtype 是要查找的值:

对于 armv7:

cpu 类型:12 cpu 子类型:9

对于 armv7s:

cpu 类型:12 cpu 子类型:11

现在我处于一种情况,我不可能将架构作为第三方更新。所以我最终改变了我的 Xcode 构建项目:

  • Xcode 设置(蓝色标签)
  • 项目和目标架构:
  • 仅添加了 armv7 的有效架构
  • 清理构建并再次运行

另一种解决方案是使用本教程破解 armv7s 库。在我的情况下不起作用

于 2013-05-26T12:09:26.200 回答