views:

338

answers:

2

From what I have read this is supposed to be when the linker (not exactly sure how that works) can't find a symbol. the symbol in question is: SCNetworkReachabilityCreateWithAddress as can be seen from the full error message below.

  • the thing is that the correct framework is added to my target.
  • xcode recognises the symbol OK, i.e. there is no error message in the .m file.
  • the .m file is added to the correct target so I'm not at all sure what to do.

Any ideas please?

"SCNetworkReachabilityCreateWithAddress", referenced from:

-[AppWelcomeVC viewDidLoad] in AppWelcomeVC.o

ld: symbol(s) not found

collect2: ld returned 1 exit status
A: 

Do you have #import <Availability.h> in your AppWelcomeVC class header, or added to your precompiled header (MyApp_Prefix.pch)?

What frameworks do you have in your project?

Alex Reynolds
If it was a problem with includes it wouldn't be a linker error - or am i missing something?
Georg Fritzsche
Actually, you're right. I've edited my answer.
Alex Reynolds
I have tried deleting and re-adding the SystemConfiguration.framework whilsts 'cleaning all targets' in between but to no avail. I am importing SystemConfiguration/SystemConfiguration.h. There's no error within the AppwelocmeVC.m where the call to SCNetworkReachabilityCreateWithAddress` is so it seems I'm importing the right framework.
Remover
also tried adding Availability.h but nothing
Remover
A: 

In the past when I've had this error removing the framework and readding it fixed the problem.

Permissions problems with the framework file itself can also cause this error.

TechZen
I have checked the permissions and the are read only for me, read-write for system but really I only need to read the file anyway, don't I? no idea what this is...
Remover
The permissions sound correct. Xcode should be working with admin privileges anyway. Perhaps it something with the call itself. You might want to post the actual code that generates the error. Just as a test, try calling the function somewhere else in the code, preferably in another object altogether and see if you get the same error.
TechZen
this turned out to be my silly mistake. when i first added the systemConfiguration framework I chose 'add files' instead of 'add framework'. so it got added to my project folder. i deleted straight away and added framework but it was getting confused somehow. to fix, i deleted systemConfiguration framework from my project folder and restarted xcode. thanks for the help.
Remover
Don't you just hate that crap? If I could add up all the time I've wasted on spelling a variable name wrong or missing a dang comma somewhere I could retire.
TechZen