私は単純な関数を書き、コンパイラを渡しますが、リンカは渡しません。
理由はありますか?
- (BOOL) connectedToWifi
{
CFArrayRef myArray = CNCopySupportedInterfaces();
// Get the dictionary containing the captive network infomation
CFDictionaryRef captiveNtwrkDict = CNCopyCurrentNetworkInfo(CFArrayGetValueAtIndex(myArray, 0));
NSLog(@"Information of the network we're connected to: %@", captiveNtwrkDict);
NSDictionary *dict = (__bridge NSDictionary*) captiveNtwrkDict;
NSString* ssid = [dict objectForKey:@"SSID"];
if ([ssid rangeOfString:@"WXYZ"].location == NSNotFound || ssid == NULL)
{
return false;
}
else
{
return true;
}
}
これは私が得るエラーです:
Undefined symbols for architecture i386:
"_CNCopySupportedInterfaces", referenced from:
-[miApp_funcs connectedToWifi] in miApp_funcs.o
"_CNCopyCurrentNetworkInfo", referenced from:
-[miApp_funcs connectedToWifi] in miApp_funcs.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)