我已经添加了这些文件到我的项目:使用ASIHTTPRequest与项目,该项目采用ARC
ASICacheDelegate.h
ASIDataCompressor.h
ASIDataCompressor.m
ASIDataDecompressor.h
ASIDataDecompressor.m
ASIDownloadCache.h
ASIDownloadCache.m
ASIFormDataRequest.h
ASIFormDataRequest.m
ASIHTTPRequest.h
ASIHTTPRequest.m
ASIHTTPRequestConfig.h
ASIHTTPRequestDelegate.h
ASIInputStream.h
ASIInputStream.m
ASINetworkQueue.h
ASINetworkQueue.m
ASIProgressDelegate.h
然后在项目的构建阶段加入-fno-objc-arc
,因为我的项目是使用ARC和ASIHTTPRequest不使用它写。当我尝试编译项目中,我得到这些错误:
Undefined symbols for architecture x86_64:
"_SCDynamicStoreCopyProxies", referenced from:
-[ASIHTTPRequest configureProxies] in ASIHTTPRequest.o
"_deflate", referenced from:
-[ASIDataCompressor compressBytes:length:error:shouldFinish:] in ASIDataCompressor.o
"_deflateEnd", referenced from:
-[ASIDataCompressor closeStream] in ASIDataCompressor.o
"_deflateInit2_", referenced from:
-[ASIDataCompressor setupStream] in ASIDataCompressor.o
"_inflate", referenced from:
-[ASIDataDecompressor uncompressBytes:length:error:] in ASIDataDecompressor.o
"_inflateEnd", referenced from:
-[ASIDataDecompressor closeStream] in ASIDataDecompressor.o
"_inflateInit2_", referenced from:
-[ASIDataDecompressor setupStream] in ASIDataDecompressor.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
我所试图做ASIHTTPRequest:
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"https://graph.facebook.com/me/photos?access_token=%@", access_token]];
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
[request addFile:@"/Users/development/Desktop/12t.png" forKey:@"file"];
[request setPostValue:[NSString stringWithFormat:@"This is a test."] forKey:@"message"];
[request startAsynchronous];
如果我添加CoreGraphics中,zlib的,CFNetwork框架和SystemConfiguration框架(MobileCoreServices未在我的Xcode中找到)我得到这些错误:
Undefined symbols for architecture x86_64:
"_Gestalt", referenced from:
-[oglView(checkOSXVersion) checkForOSVersion:] in oglView+checkOSXVersion.o
+[ASIHTTPRequest defaultUserAgentString] in ASIHTTPRequest.o
"_UTTypeCopyPreferredTagWithClass", referenced from:
+[ASIHTTPRequest mimeTypeForFileAtPath:] in ASIHTTPRequest.o
"_UTTypeCreatePreferredIdentifierForTag", 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 x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
问题更新 – hockeyman
您需要添加libz.dylib和MobileCoreServices。他们绝对都应该在那里。如果不是libz,请尝试libz.1.2.5。 –