12

SystemConfiguration フレームワークを追加しました。3.2 以降のターゲットに対してデプロイしています。何かを追加するのを忘れましたか?

Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_Reachability", referenced from:
      objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
4

3 に答える 3

41

Okay, the clues are all in the error report you have posted.

While linking (the message is from the linker ld) which occurs after compilation of all the symbols across your project, the message is saying

"In AppDelegate, you have referenced a class object called Reachability"

"_OBJC_CLASS_$_Reachability"

and as far as the linker is concerned Reachability is undefined.

So, check that Reachability is being compiled in your project. The are a couple of ways to do this. Perhaps the most clear way is to enter image description here

1 select the project file in the navigation pane

2 select the target

3 select Build Phases

4 Expand the Compile Sources section

*Now check the list of sources that will be compiled for your missing class, in your case Reachability.m

If it is missing, use the + button to add the file to the target.

Another way is to

enter image description here

1 select the file you think is not being compiled

2 open the utilities panel

3 select the file inspector tab

There will be a checkbox for each target in your project and you can easily see if your .m file is being compiled for each/all targets or not.

于 2012-04-12T08:02:17.303 に答える
1

プロジェクトに到達可能性クラスを含めるのを忘れている可能性があります。

于 2012-07-11T17:22:29.450 に答える
0

Mixpanel の最新バージョンにアップグレードしたときに、同様の問題が発生しました。エラーは次のとおりです。

Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_CTTelephonyNetworkInfo", referenced from:
      objc-class-ref in Mixpanel.o

最後のステップまで Damo のソリューションに従うことができます。その後、Compile Sourcesセクションを展開する代わりに、 Link Binary With Librariesセクションを展開し、 CTTelephonyNetworkInfo を含む CoreTelephony.frameworkソースを追加する必要があります。

CTTelephonyNetworkInfo クラス リファレンスの詳細については、Apple の公式 Web サイト ( http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Reference/CTTelephonyNetworkInfo/Reference/Reference.html ) を参照してください。

于 2013-01-10T07:23:24.007 に答える