3

これらのファイルをプロジェクトに追加しました。

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 フレームワークを追加すると (Xcode に MobileCoreServices が見つかりません)、次のエラーが発生します。

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)
4

5 に答える 5

6

ASIHttprequestMac OS X プロジェクトで使用しているようです。したがって、この指示に従う必要があります。

Mac OS X プロジェクトでの ASIHTTPRequest の使用

Mac プロジェクトで ASIHTTPRequest を使用するには、以下にリンクする必要があります。

  • SystemConfiguration.framework + zlib (上記と同様)
  • CoreServices.framework CFNetwork は、Mac OS X の CoreServices フレームワークの一部です。コンソール ベースのアプリケーションを作成している場合を除き、アプリケーションはおそらく既に CoreServices とリンクするように設定されていますが、そうでない場合は、単に CoreServices.framework を次のように追加します。上で説明した。

から: http://allseeing-i.com/ASIHTTPRequest/Setup-instructions

于 2012-12-04T07:11:26.723 に答える
4

必要ないくつかのライブラリを追加する必要があり、ASSIHTTP はこれらのフレームワークを使用しています。これらのフレームワークは次のとおりです。 -libz.dylib -systemConfiguration -MobileCoreServices -CFNetwork

于 2013-10-08T12:55:58.950 に答える
0

ASI が依存しているライブラリが含まれていないようです。セットアップ手順、具体的にはステップ 2 を確認してください。

Link with CFNetwork, SystemConfiguration, MobileCoreServices, CoreGraphics and zlib
于 2012-10-22T14:55:07.227 に答える
0

すべての依存関係を含めましたか? あなたは何も言及しなかったからです。 http://allseeing-i.com/ASIHTTPRequest/Setup-instructions CFNetwork、SystemConfiguration、MobileCoreServices、CoreGraphics、および zlib も含める必要があります。

zlib と MobileCoreServices

ちなみに、zlib が見つからない場合は、libz.x.dylib を含めることができます (私自身は zlib を持っていません)。また、CoreService フレームワークにある必要があるため、MobileCoreServices.framework が必要です。持っていない場合は、ASI を機能させるために再度インストールするしかありません。

于 2012-10-22T14:55:47.177 に答える
0

これを試してください: - プロジェクトを選択します - ターゲット - ビルド フェーズを選択します - ASIHTTPRequest .m ファイルが [ライブラリとバイナリをリンクする] に追加されたかどうかを確認します

于 2012-10-22T14:56:16.660 に答える