我的项目链接到三个静态库,包含在其他三个项目中.我已经使用标准流程来链接库(将项目文件拖到我的库中,将他们的产品添加为目标依赖项,将lib —.一个文件添加到Link Binary With Libraries阶段).实际上,对于模拟器或我的测试设备,使用Debug Build Configuration进行编译没有问题.
一切顺利的是当我使用Release Build Configuration进行编译时,或者当我尝试存档时.根据我的设置,我遇到了很多不同的错误,但大多数都有不同的错误:
ld: warning: ignoring file
[…]/Build/Products/Debug-iphonesimulator/libGDataTouchStaticLib.a,
file was built for archive which is
not the architecture being linked
(armv6) Undefined symbols for
architecture armv6:
“_OBJC_CLASS_$_GDataSpreadsheetData”,
referenced from:
objc-class-ref in ExportViewController.o
我无法理解为什么它甚至在Debug-iphonesimulator目录中查看产品(我发誓,我链接的所有内容都在Finder中显示在适当的Release-iphoneos目录中).
我已经花了一些荒谬的时间来解决这个问题,真的需要帮助!谢谢!
解决方法
Xcode4 Linking Problem. File was built for archive which is not the architecture being linked (arm6)