xcode collect2: ld returned 1 exit status - how to resolve?

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

Answers


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?


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.


Need Your Help