当尝试用Xcode编译时,我得到了以下错误:
**Ld /Users/doronkatz/Library/Developer/Xcode/DerivedData/iKosher-bphnihrngmqtkqfgievrrumzmyce/Build/Products/Debug-iphonesimulator/iKosher.app/iKosher normal i386
cd /Users/doronkatz/Sites/xCode/iKosher
setenv MACOSX_DEPLOYMENT_TARGET 10.6
setenv PATH "/Xcode4/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Xcode4/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Xcode4/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 -arch i386 -isysroot /Xcode4/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sdk -L/Users/doronkatz/Library/Developer/Xcode/DerivedData/iKosher-bphnihrngmqtkqfgievrrumzmyce/Build/Products/Debug-iphonesimulator -L/Users/doronkatz/Sites/xCode/iKosher -F/Users/doronkatz/Library/Developer/Xcode/DerivedData/iKosher-bphnihrngmqtkqfgievrrumzmyce/Build/Products/Debug-iphonesimulator -filelist /Users/doronkatz/Library/Developer/Xcode/DerivedData/iKosher-bphnihrngmqtkqfgievrrumzmyce/Build/Intermediates/iKosher.build/Debug-iphonesimulator/iKosher.build/Objects-normal/i386/iKosher.LinkFileList -mmacosx-version-min=10.6 -all_load -ObjC -Xlinker -objc_abi_version -Xlinker 2 -lz -framework Security -framework CFNetwork -framework CoreData -framework Foundation -framework UIKit -framework CoreGraphics -framework QuartzCore -o /Users/doronkatz/Library/Developer/Xcode/DerivedData/iKosher-bphnihrngmqtkqfgievrrumzmyce/Build/Products/Debug-iphonesimulator/iKosher.app/iKosher
Undefined symbols for architecture i386:
"_UTTypeCreatePreferredIdentifierForTag", referenced from:
+[ASIHTTPRequest mimeTypeForFileAtPath:] in ASIHTTPRequest.o
"_UTTypeCopyPreferredTagWithClass", referenced from:
+[ASIHTTPRequest mimeTypeForFileAtPath:] in ASIHTTPRequest.o
"_kUTTagClassMIMEType", referenced from:
+[ASIHTTPRequest mimeTypeForFileAtPath:] in ASIHTTPRequest.o
"_kUTTagClassFilenameExtension", referenced from:
+[ASIHTTPRequest mimeTypeForFileAtPath:] in ASIHTTPRequest.o
"_SCNetworkReachabilitySetCallback", referenced from:
-[Reachability startNotifier] in Reachability.o
"_SCNetworkReachabilityScheduleWithRunLoop", referenced from:
-[Reachability startNotifier] in Reachability.o
"_SCNetworkReachabilityUnscheduleFromRunLoop", referenced from:
-[Reachability stopNotifier] in Reachability.o
"_SCNetworkReachabilityCreateWithName", referenced from:
+[Reachability reachabilityWithHostName:] in Reachability.o
"_SCNetworkReachabilityCreateWithAddress", referenced from:
+[Reachability reachabilityWithAddress:] in Reachability.o
"_SCNetworkReachabilityGetFlags", referenced from:
-[Reachability currentReachabilityStatus] in Reachability.o
-[Reachability isReachable] in Reachability.o
-[Reachability isConnectionRequired] in Reachability.o
-[Reachability isConnectionOnDemand] in Reachability.o
-[Reachability isInterventionRequired] in Reachability.o
-[Reachability isReachableViaWWAN] in Reachability.o
-[Reachability isReachableViaWiFi] in Reachability.o
...
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status**
不知道这是什么意思。
发布于 2011-01-30 08:01:07
您正在使用ASIHTTPRequest,因此需要设置您的项目。请在此处阅读第二部分
发布于 2011-01-30 07:47:46
如果你突然出现这样的东西,通常意味着项目缺少一些它需要的框架。库和依赖项目可能需要框架,所以如果您最近添加了一个框架,则可能会导致此错误。
要添加框架,右键单击项目视图中的项目名称,选择Add
,然后从列表中选择Existing frameworks...
。然后找到包含您缺少的符号的框架。
至于你如何找到你需要的框架,我发现使用google是最简单的,尽管你也可以使用Xcode帮助搜索。搜索其中一个符号,尽最大努力找出未损坏的名称(例如,SCNetworkReachabilityGetFlags
),然后在developer.apple.com上找到的第一个文档链接通常是正确的。你通常不需要猎取很远的地方。在本例中,就是这个页面:
https://developer.apple.com/documentation/systemconfiguration/scnetworkreachability-g7d
然后在页面的顶部,它告诉您要使用哪个框架,在本例中是SystemConfiguration
。因此,将其添加到项目中,然后重新编译。
然后继续这样做直到它起作用。
编辑:我从来没有用过模拟器,但这是你在设备上做的事情--我假设它是一样的……
发布于 2011-03-29 03:06:03
我使用以下方法(针对XCode 4)解决了这个问题:
1)在项目导航窗口中选择项目,右侧显示项目摘要
2)选择第4个选项卡构建阶段
3)选择使用库链接二进制文件选项
4)添加您要获取的框架
5)将框架从主文件夹移动到框架文件夹
6)重新构建它,错误就会消失。
https://stackoverflow.com/questions/4839981
复制相似问题