_objc_retain", referenced from:__ARCLite__load error in Xcode 4.4
Asked Answered
L

3

5

I've recently upgraded to Xcode 4.4 and have been using it for some Mac App Store submissions. Two worked fine but the third gave this error:

Undefined symbols for architecture x86_64:
  "_objc_retain", referenced from:
      ___ARCLite__load in libarclite_macosx.a(arclite.o)
     (maybe you meant: _objc_retainedObject)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

ARC is turned off so I don't know where this reference is coming from, or how to get rid of it. I've tried the usual clean/build cycle but to no avail.

Any thoughts?

Lesleylesli answered 31/7, 2012 at 19:6 Comment(2)
I assume that you have tried turning the Build active architecture only to "Yes" in the Project -> Build Setting -> Architectures, right?Turgent
Are you using any ARC-enabled frameworks in this application?Surprising
T
16

I think you should use the SDK 10.6 on Xcode 4.4,right? If so, please Change "Implicitly Link Objective-C Runtime Support" to "NO".

Tomfoolery answered 23/9, 2012 at 1:50 Comment(2)
This worked for me but what is the impact of changing that setting?Pesthouse
Never ask why when working on older SDKs. Just thank the person who posted the answer and move on! Thank you @Tomfoolery - it worked for me too. (I got there by starting a project in Xcode 7, using ARC, latest SDK, and then later converting it to build on the 10.6 SDK with manual retain/release so I could test some of its code for use in an older project.)Dronski
M
2

Is your base sdk lower than 5.0? I'm using Xcode4.5, and get the same error when i building with iOS 4.2.After I changed it to iOS5.0(or above), the error disappeared.

I'm sorry,you talked about Mac app.But i think the reason may be the same. OK,i found an answer: Change "Implicitly Link Objective-C Runtime Support" to NO may work.

Mythological answered 21/9, 2012 at 3:20 Comment(1)
Changing "Implicitly Link Objective-C Runtime Support" to NO worked for me (iOS 4.2 deployment target with Xcode 4.4.1).Stinkhorn
R
1

I had the same problem in Xcode 7.0.1 with iOS 7.0. The solution was to change the Deployment Target from 7.0 to 7.1.

Rathbun answered 13/10, 2015 at 6:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.