2013-10-07 8 views
12

すべてのAFNetworkingライブラリファイルを自分のプロジェクト(githubからダウンロードしたもの)に追加しました。私は自分のアプリケーションに他のView Controller /クラスなどを作成していませんでした。私は自分のアプリケーションを構築し、9つのエラー "アーキテクチャの未定義シンボル"を見つけました。どんな助けもありがとう。AFNetworking "アーキテクチャi386の未定義のシンボル"エラー

私はエラーのリストをリストアップしました。

Undefined symbols for architecture i386: 

"_SecCertificateCopyData", referenced from: 
-[AFURLConnectionOperation connection:willSendRequestForAuthenticationChallenge:] in AFURLConnectionOperation.o 

"_SecCertificateCreateWithData", referenced from:___44+[AFURLConnectionOperation pinnedPublicKeys]_block_invoke in AFURLConnectionOperation.o 

"_SecPolicyCreateBasicX509", referenced from:___44+[AFURLConnectionOperation pinnedPublicKeys]_block_invoke in AFURLConnectionOperation.o 

-[AFURLConnectionOperation connection:willSendRequestForAuthenticationChallenge:] in AFURLConnectionOperation.o "_SecTrustCopyPublicKey", referenced from:___44+[AFURLConnectionOperation pinnedPublicKeys]_block_invoke in AFURLConnectionOperation.o 

-[AFURLConnectionOperation connection:willSendRequestForAuthenticationChallenge:] in AFURLConnectionOperation.o "_SecTrustCreateWithCertificates", referenced from:___44+[AFURLConnectionOperation pinnedPublicKeys]_block_invoke in AFURLConnectionOperation.o 

-[AFURLConnectionOperation connection:willSendRequestForAuthenticationChallenge:] in AFURLConnectionOperation.o "_SecTrustEvaluate", referenced from:___44+[AFURLConnectionOperation pinnedPublicKeys]_block_invoke in AFURLConnectionOperation.o 

-[AFURLConnectionOperation connection:willSendRequestForAuthenticationChallenge:] in AFURLConnectionOperation.o "_SecTrustGetCertificateAtIndex", referenced from:-[AFURLConnectionOperation connection:willSendRequestForAuthenticationChallenge:] in AFURLConnectionOperation.o 

から参照 "_SecTrustGetCertificateCount"、 - [AFURLConnectionOperation接続:willSendRequestForAuthenticationChallengeは:] AFURLConnectionOperation.o

にLD:記号(S)i386アーキテクチャ 打ち鳴らすが見つかりません:エラー:リンカーコマンドはで失敗しました終了コード1(呼び出しには-vを使用してください)

+1

はあなたがSystemConfiguration、セキュリティとMobileCoreServiceフレームワークが含まれたMobileCoreServices.framework? – CarlJ

+2

iOSプロジェクトに 'SystemConfiguration.Framework'を追加する必要があると思います – Buntylm

+3

セキュリティフレームワークを追加するだけです – Saify

答えて

11

iOSプロジェクトにSecurity.frameworkを追加する必要があると思います。

enter image description here

enter image description here

+0

'Sec'は' SC'ではありません。フレームワークOPが探しているのはSystemConfigurationではなくSecurityです。 –

+0

@ H2CO3ああ私の間違いだと私は投票して下さったことに感謝します。私もそれを更新します。 – Buntylm

2

AFNetworkingのファイルをプロジェクトに追加する場合は、プロジェクトの対象メンバシップにAFNetworking.mが選択されていることを確認してください。

AFNetworking.mファイルを開いてファイルインスペクタで修正することができます。プロジェクトのターゲットメンバーシップをチェックするだけです。

また、AFNetworkingを機能させるために、関連するすべてのフレームワークをプロジェクトに含めるようにしてください。 つまり、systemConfiguration、セキュリティフレームワーク。

+0

-1これは間違っています。ちょうどエラーメッセージを見てください。他の**ファイルは 'AFNetworking.m'で定義されたシンボルを見つけません。それはまさに 'AFNetworking.m'のメソッドが' Security.framework'の関数を参照しているので、これは問題を解決しません。 –

4

「セキュリティ」フレームワークを含めます。すべてがうまくいく。

乾杯!

+0

+1これは正しいです。 –

4

私も同じ問題に直面していたが、今、私は私のせいを発見しました。あなたは同様の問題に直面している場合 は、次のフレームワークが追加されたチェックを行う

  1. Security.framework
  2. SystemConfiguration.framework
関連する問題