Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding Reachability class fails when I am trying to build

I have added the SystemConfiguration framework. I am deploying against targets from 3.2 and higher. Have I forgotten to add something?

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)
like image 940
LuckyLuke Avatar asked Apr 12 '12 07:04

LuckyLuke


2 Answers

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.

like image 111
Damo Avatar answered Sep 18 '22 19:09

Damo


You might have forgotten to include the Reachability classes in your project!

like image 28
Developer Avatar answered Sep 17 '22 19:09

Developer