ARC error when deploying to 10.6

I have an application that works and is testing on 10.7, but later realized that I need it to work with earlier versions. And unfortunately, I started this project with ARC from the very beginning.

Now my build installation is the sdk: 10.7 debugging base and the base sdk: 10.6 release. And when I try to archive my application, I got the following error:

Undefined symbols for architecture x86_64:
"_objc_retain", referenced from:
  +[__ARCLite__ load] in libarclite_macosx.a(arclite.o)
  -[AppDelegate applicationDidFinishLaunching:] in AppDelegate.o
  -[AppDelegate managedObjectModel] in AppDelegate.o
  -[AppDelegate persistentStoreCoordinator] in AppDelegate.o
  -[AppDelegate managedObjectContext] in AppDelegate.o
  -[AppDelegate windowWillReturnUndoManager:] in AppDelegate.o
  -[AppDelegate saveAction:] in AppDelegate.o
  ...
 (maybe you meant: _objc_retainedObject)
"_objc_release", referenced from:
  -[AppDelegate applicationDidFinishLaunching:] in AppDelegate.o
  -[AppDelegate applicationFilesDirectory] in AppDelegate.o
  -[AppDelegate managedObjectModel] in AppDelegate.o
  -[AppDelegate persistentStoreCoordinator] in AppDelegate.o
  -[AppDelegate managedObjectContext] in AppDelegate.o
  -[AppDelegate windowWillReturnUndoManager:] in AppDelegate.o
  -[AppDelegate saveAction:] in AppDelegate.o
  ...
"_objc_retainAutoreleasedReturnValue", referenced from:
  -[AppDelegate applicationFilesDirectory] in AppDelegate.o
  -[AppDelegate managedObjectModel] in AppDelegate.o
  -[AppDelegate persistentStoreCoordinator] in AppDelegate.o
  -[AppDelegate managedObjectContext] in AppDelegate.o
  -[AppDelegate windowWillReturnUndoManager:] in AppDelegate.o
  -[AppDelegate saveAction:] in AppDelegate.o
  -[AppDelegate applicationShouldTerminate:] in AppDelegate.o
  ...
"_objc_autoreleaseReturnValue", referenced from:
  -[AppDelegate applicationFilesDirectory] in AppDelegate.o
  -[AppDelegate managedObjectModel] in AppDelegate.o
  -[AppDelegate persistentStoreCoordinator] in AppDelegate.o
  -[AppDelegate managedObjectContext] in AppDelegate.o
  -[AppDelegate windowWillReturnUndoManager:] in AppDelegate.o
  -[MainWindowController viewForTag:] in MainWindowController.o
  -[MainWindowController tableView:objectValueForTableColumn:row:] in MainWindowController.o
  ...
"_objc_storeStrong", referenced from:
  -[AppDelegate persistentStoreCoordinator] in AppDelegate.o
  -[AppDelegate saveAction:] in AppDelegate.o
  -[AppDelegate applicationShouldTerminate:] in AppDelegate.o
  -[AppDelegate .cxx_destruct] in AppDelegate.o
  -[MainWindowController init] in MainWindowController.o
  -[MainWindowController viewForTag:] in MainWindowController.o
  -[MainWindowController showUserFinderView:] in MainWindowController.o
  ...
"_objc_retainAutoreleaseReturnValue", referenced from:
  +[MainWindowController sharedInstance] in MainWindowController.o
  -[FileMetaData getFileName] in FileMetaData.o
  -[FileMetaData getLastHash] in FileMetaData.o
  -[FileMetaData getCreationDate] in FileMetaData.o
  -[FileMetaData getLastModified] in FileMetaData.oe
  -[FileMetaData getLocalPath] in FileMetaData.o
  ...
"_objc_autorelease", referenced from:
  -[SBJsonParser objectWithString:error:] in SBJsonParser.o
  -[SBJsonTokeniser getStringToken:] in SBJsonTokeniser.o
  -[SBJsonTokeniser getNumberToken:] in SBJsonTokeniser.o
  -[SBJsonUTF8Stream getRetainedStringFragment:] in SBJsonUTF8Stream.o
  -[SBJsonWriter stringWithObject:error:] in SBJsonWriter.o
"_objc_retainAutorelease", referenced from:
  -[SBJsonTokeniser getStringToken:] in SBJsonTokeniser.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

This seems like a problem with ARC, but I don't know where to start the fix. Any suggestions? Thank.

+5
source share
2 answers

You need to set the SDK to 10.7, but you can set the deployment target to 10.6. There are some caveats in this question: How to deploy Snow Leopard with ARC support

+10

, . SDK 10.7, ​​ 10.6, .

– release ARC. , ARC , -fobjc-arc ( " " ).

ARC , ( -fno-objc-arc ) 10.6.

+3

All Articles