部署到10.6时出现ARC错误 [英] ARC error when deploying to 10.6
问题描述
我有我的应用程序在10.7运行和测试,但后来意识到,我需要它在早期版本上工作。不幸的是,我从一开始就开始这个项目与ARC。
I have my app running and tested on 10.7 but later realized that I needed it to work on earlier versions as well. And unfortunately, I started this project with ARC on from the very beginning.
现在我的构建设置是debug base sdk:10.7,并发布基础sdk:10.6。当我尝试归档我的应用程序,我得到以下错误:
Now my build setup is debug base sdk: 10.7, and release base sdk: 10.6. And when I try to archive my app, 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)
它看起来像ARC的问题,但我不知道从哪里开始修复这。有什么建议么?感谢。
It looks like an issue with ARC, but I have no clue where to start on fixing this. Any suggestions? Thanks.
推荐答案
您需要将SDK设置为10.7 - 但是您可以将部署目标设置为10.6。虽然在此问题中有详细说明,但有一些注意事项:如何部署启用ARC的雪豹
You need to set the SDK to 10.7 - but you can set the Deployment target to 10.6. There are some caveats though detailed in this question: How to deploy to Snow Leopard with ARC enabled
这篇关于部署到10.6时出现ARC错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!