12

我知道这种类型的错误以前曾多次提出过,但我还没有找到解决我的错误的方法。我正在使用 xcode 4.0。我下载了 ASIHTTPRequest zip 并复制了 classes 文件夹以及两个“Reachability”文件。编译后,它给了我奇怪的错误,我无法弄清楚。下面我为架构 i386 复制了未定义符号的错误文本。

Ld /Users/svp/Library/Developer/Xcode/DerivedData/Manual_BeforePres2-fahkeiivemkgpubswgvzglvndszw/Build/Products/Debug-iphonesimulator/Manual.app/Manual normal i386
cd "/Users/svp/Desktop/Manual nav before pres 2"
setenv MACOSX_DEPLOYMENT_TARGET 10.6
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-gcc-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk -L/Users/svp/Library/Developer/Xcode/DerivedData/Manual_BeforePres2-fahkeiivemkgpubswgvzglvndszw/Build/Products/Debug-iphonesimulator -F/Users/svp/Library/Developer/Xcode/DerivedData/Manual_BeforePres2-fahkeiivemkgpubswgvzglvndszw/Build/Products/Debug-iphonesimulator -filelist /Users/svp/Library/Developer/Xcode/DerivedData/Manual_BeforePres2-fahkeiivemkgpubswgvzglvndszw/Build/Intermediates/Manual_BeforePres2.build/Debug-iphonesimulator/Manual.build/Objects-normal/i386/Manual.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -lz -framework SystemConfiguration -framework CFNetwork -framework UIKit -framework Foundation -framework CoreGraphics -o /Users/svp/Library/Developer/Xcode/DerivedData/Manual_BeforePres2-fahkeiivemkgpubswgvzglvndszw/Build/Products/Debug-iphonesimulator/Manual.app/Manual

 Undefined symbols for architecture i386:
"_UTTypeCreatePreferredIdentifierForTag", referenced from:
  +[ASIHTTPRequest mimeTypeForFileAtPath:] in ASIHTTPRequest.o
"_UTTypeCopyPreferredTagWithClass", referenced from:
  +[ASIHTTPRequest mimeTypeForFileAtPath:] in ASIHTTPRequest.o
"_kUTTagClassFilenameExtension", referenced from:
  +[ASIHTTPRequest mimeTypeForFileAtPath:] in ASIHTTPRequest.o
"_kUTTagClassMIMEType", referenced from:
  +[ASIHTTPRequest mimeTypeForFileAtPath:] in ASIHTTPRequest.o
ld: symbol(s) not found for architecture i386

collect2: ld returned 1 exit status

它还在ASIAuthenticationDialog.m文件中给我一个警告:

ASIAuthenticationDialog may not respond to _presentingViewController

请任何人告诉我这些错误和警告是什么?我究竟做错了什么?我为此浪费了很多时间:(

编辑:

文件中的警告代码ASIAuthenticationDialog.m

#import "ASIAuthenticationDialog.h"
#import "ASIHTTPRequest.h"

#pragma mark show / dismiss

+ (void)dismiss
{
if ([sharedDialog respondsToSelector:@selector(presentingViewController)])
    [[sharedDialog presentingViewController] dismissModalViewControllerAnimated:YES];
else 
    [[sharedDialog parentViewController] dismissModalViewControllerAnimated:YES];
}
4

1 回答 1

36

如果您要在文档中查找缺少的符号,您会发现它们与它们所在的框架一起列出。例如,UTTypeCreatePreferredIdentifierForTag说它位于 MobileCoreServices.framework 中。(其他的也可能在那里;我没有寻找所有这些。)将必要的框架添加到目标构建阶段的链接库步骤中,并且应该解析符号。

至于警告,请显示它发生的代码。

于 2012-07-18T20:58:45.213 回答