Xcode 4 Final - "armv6 armv7" issue while linking with armv6 libs
Asked Answered
E

5

17

Until xcode 4 final (I was using 3.latest and 4 GM for the time it was available) this didn't happen. When I upgraded to xcode 4 final version, I started getting a linking error while trying to link the armv7 version with my non armv7 library (my project is set with the default Standard armv6 armv7 valid architectures):

ld: warning: ignoring file ../bin/iOS static/arm/libssl.a, file was built for archive which is not the architecture being linked (armv7)
ld: warning: ignoring file ../bin/iOS static/arm/libcrypto.a, file was built for archive which is not the architecture being linked (armv7)
Undefined symbols for architecture armv7: -- list of symbols --

The armv6 version compiles just fine, but the overall compilation process fails with 77 link errors.

I understand this is the expected behavior, it wont link towards armv7 with an armv6 lib. The fix is setting my project to armv6 only. My question here is: why was this working in the previous versions of xcode?

If I set to armv6 only, I start to get this warning:

Check dependencies

[BWARN]warning: all apps should include an armv7 architecture (current ARCHS = "armv6").

I don't like seeing warnings :-) Anybody having similar issues?

Thanks,

Fernando

Evade answered 15/3, 2011 at 18:48 Comment(0)
F
22

I just turned the Build active architecture only to Yes in the Project -> Build Setting -> Architectures tab.

Forthright answered 1/4, 2011 at 12:28 Comment(2)
i'd say that only prevents this error to happen for the current device. once you archive for submission you would want to support all architecturesNarwhal
THX - This fixed the following problem: Error: Undefined symbols for architecture armv7s: "_OBJC_CLASS_$_QREncoder", referenced from: Warning: ld: warning: ignoring file /Users/neo/Library/Developer/Xcode/DerivedData/WinNav-fycjhbccktevjdbrxudedbysqxmy/Build/Products/Debug-iphoneos/libqrencoder.a, file was built for archive which is not the architecture being linked (armv7s): /Users/neo/Library/Developer/Xcode/DerivedData/WinNav-fycjhbccktevjdbrxudedbysqxmy/Build/Products/Debug-iphoneos/libqrencoder.aCobbie
G
7

In iOS SDK 4.3, it looks like the linker will simply refuse to use a armv6 library in an armv7 binary - this wasn't the case before.

That's why I had to update the http://code.google.com/p/ios-static-libraries/ project to generate both armv6 and armv7 versions of the libraries.

Gentilis answered 28/3, 2011 at 0:55 Comment(0)
P
3

I have added 3rd Party framework with some demo classes into project but once implemented it successfully I removed those demo classes and since then the error started coming up Error "ld: ........., file is universal but does not contain a(n) armv6 slice for architecture armv6"

After scratching my head for a whole day I found this solution next morning maybe helpful for fellow iphone buddies coz I know the pain

Targets->"Your Project Target"-> Get Info ->Build Active Architecture only set to YES

Thats it..

Planer answered 7/7, 2011 at 3:13 Comment(0)
T
1

Had the same problem. But the reason was different I suppose. I was using the library.a file built for simulator and trying to run it on device.. came to know that i need different .a files for simulator and device. I hope this helps someone ;)

Tolman answered 17/1, 2012 at 9:20 Comment(2)
where i would get different .a file for device , i need to run it on device its running fine but database is blank not working fineCalciferol
you can use the same code from which you are generating file for simulator, to generate a file for device. You just have to change the target to device.Tolman
E
0

Although I still don't know why this started happening only in the xcode 4 final version, I found that my external libs (ssl and crypto) were compiled against both armv6 and armv7 in the google code project very few days ago:

http://code.google.com/p/ios-static-libraries/

This will fix the issue if you define two different library search path: one for armv6, one for armv7.

Thanks,

Evade answered 15/3, 2011 at 19:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.