问题
My application builds fine for the simulator but not the device:
ld: warning: ignoring file /Users/newuser/Downloads/release-1.5-tag/build/Release-iphoneos/parsekit.a, file was built for archive which is not the architecture being linked (armv7)
I'm using the ParseKit lib which doesn't seem to like being mixed with armv7.
I think I have to do some form of linking with the library? But how?
Thanks.
回答1:
You seem to have linked the library, only it is not built for armv7.
The ParseKit Xcode project has a target called ParseKitMobile, which is built for armv7. Try using that.
You could also try changing the "Base SDK" setting to iOS, that should give you arm options for the architecture.
回答2:
Chances are that you'll have to re-compile ParseKit for the armv7
architecture. Are you following the instructions for iPhone on the ParseKit homepage? It does not seem to mention armv7 explicitly, but I guess if you add parsekit.a
as a target from ParseKit's project file to your own project file, then XCode should recognize that the target has to be re-built for armv7
.
Note: the instructions are for XCode 3 and I guess you are using XCode 4, but the whole idea should be the same.
回答3:
parsekit.a
is a static library and it has to be statically linked with binaries having the same ABI. So you have following options:
- Build you code for the same ABI as
parsekit.a
has; - Build
parsekit.a
for the armv7; - Build parsekit as a shared library;
- Write wrapper for
parsekit.a
that will be built as shared library and expose all the API you need.
来源:https://stackoverflow.com/questions/7214789/xcode-armv7-issue