2013-02-07 45 views
1

我有我的靜態庫 在這個項目中,我添加了一個Reachability.h .m文件。 所以,我有一些鏈接錯誤: 我還添加了CFNetwork的和System.Configuration framwork在靜態庫中添加可達性

Undefined symbols for architecture i386: 
    "_SCNetworkReachabilityCreateWithAddress", referenced from: 
     +[Reachability reachabilityWithAddress:] in libAdvertisingPromotions.a(Reachability.o) 
    "_SCNetworkReachabilityCreateWithName", referenced from: 
     +[Reachability reachabilityWithHostName:] in libAdvertisingPromotions.a(Reachability.o) 
    "_SCNetworkReachabilityGetFlags", referenced from: 
     -[Reachability connectionRequired] in libAdvertisingPromotions.a(Reachability.o) 
     -[Reachability currentReachabilityStatus] in libAdvertisingPromotions.a(Reachability.o) 
    "_SCNetworkReachabilityScheduleWithRunLoop", referenced from: 
     -[Reachability startNotifier] in libAdvertisingPromotions.a(Reachability.o) 
    "_SCNetworkReachabilitySetCallback", referenced from: 
     -[Reachability startNotifier] in libAdvertisingPromotions.a(Reachability.o) 
    "_SCNetworkReachabilityUnscheduleFromRunLoop", referenced from: 
     -[Reachability stopNotifier] in libAdvertisingPromotions.a(Reachability.o) 
ld: symbol(s) not found for architecture i386 
clang: error: linker command failed with exit code 1 (use -v to see invocation) 

回答

1

我已經解決了這個... 我在使用我的靜態庫

+0

這是雖然固定它的唯一途徑我的測試應用程序的項目添加systemconfiguration.framework?你不應該能夠將systemconfiguration.framework包含在靜態庫中而不是應用程序項目中嗎? – Mark

0

您必須確保,您Reachability.h .M被編譯。你需要去你的「構建階段」,然後到「編譯SOURCES」並添加Reachability.m來編譯源代碼。