Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Objective C: ARC errors (Automatic release problems) [duplicate]

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

like image 232
cusquinho Avatar asked Mar 15 '11 18:03

cusquinho


3 Answers

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

like image 159
Rick Avatar answered Oct 12 '22 20:10

Rick


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.

like image 37
Pol Avatar answered Oct 12 '22 20:10

Pol


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..

like image 39
Kiran S Avatar answered Oct 12 '22 18:10

Kiran S