简体   繁体   中英

Error using Reachability.h on Xcode 4.0

I am having some problems adding Reachability to my project. I just used Reachability before, but this time I am failing. I always having the error below:

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

My project don't use ARC (and I don't want it), base sdk 5.0, ARchitecture standard (armv7) and I already add the SystemConfiguration.framework.

I also tested the Tony million Reachability and it does not work. Same problem.

I saw the same question from other topics, but it was with ARC. My project does not have ARC.

Additionally, i am doing a simple test inside the delegate, as follows:

Reachability *reach = [Reachability reachabilityForInternetConnection]; 
    NetworkStatus netStatus = [reach currentReachabilityStatus];    
    if (!netStatus == NotReachable) {
        NSLog(@"Not connected");
    }

Thanks!

Are you sure you added the Reachability.m file to your project? Check also if it is assigned to your current target.

That error definitely means that the linker did not find the class definition anywhere among the binaries produced by the compiler for the armv7 architecture.

Add Message UI framework in your project..

Hope, this will help you...enjoy..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM