2012-06-27 132 views
0

我不斷收到鏈接錯誤,當我嘗試設置此。我使用這在我的應用程序委託配置一切實施正確撞?

- (void) configureBump { 
[BumpClient configureWithAPIKey:@"your_api_key" andUserID:[[UIDevice currentDevice] name]]; 

[[BumpClient sharedClient] setMatchBlock:^(BumpChannelID channel) { 
    NSLog(@"Matched with user: %@", [[BumpClient sharedClient] userIDForChannel:channel]); 
    [[BumpClient sharedClient] confirmMatch:YES onChannel:channel]; 
}]; 

[[BumpClient sharedClient] setChannelConfirmedBlock:^(BumpChannelID channel) { 
    NSLog(@"Channel with %@ confirmed.", [[BumpClient sharedClient] userIDForChannel:channel]); 
    [[BumpClient sharedClient] sendData:[[NSString stringWithFormat:@"Hello, world!"] dataUsingEncoding:NSUTF8StringEncoding] 
           toChannel:channel]; 
}]; 

[[BumpClient sharedClient] setDataReceivedBlock:^(BumpChannelID channel, NSData *data) { 
    NSLog(@"Data received from %@: %@", 
      [[BumpClient sharedClient] userIDForChannel:channel], 
      [NSString stringWithCString:[data bytes] encoding:NSUTF8StringEncoding]); 
}]; 

[[BumpClient sharedClient] setConnectionStateChangedBlock:^(BOOL connected) { 
    if (connected) { 
     NSLog(@"Bump connected..."); 
    } else { 
     NSLog(@"Bump disconnected..."); 
    } 
}]; 

[[BumpClient sharedClient] setBumpEventBlock:^(bump_event event) { 
    switch(event) { 
     case BUMP_EVENT_BUMP: 
      NSLog(@"Bump detected."); 
      break; 
     case BUMP_EVENT_NO_MATCH: 
      NSLog(@"No match."); 
      break; 
    } 
}]; 
} 

的錯誤,我得到如下:

Undefined symbols for architecture i386: 
"_CFHostCreateWithName", referenced from: 
    -[BumpClient ipStringForHost] in libBump.a(BumpClient-4A2ADD525826BE6B.o) 
"_CFHostStartInfoResolution", referenced from: 
    -[BumpClient ipStringForHost] in libBump.a(BumpClient-4A2ADD525826BE6B.o) 
"_CFHostGetAddressing", referenced from: 
    -[BumpClient ipStringForHost] in libBump.a(BumpClient-4A2ADD525826BE6B.o) 
"_CFHostGetNames", referenced from: 
    -[BumpClient ipStringForHost] in libBump.a(BumpClient-4A2ADD525826BE6B.o) 
"_OBJC_CLASS_$_CLLocationManager", referenced from: 
    objc-class-ref in libBump.a(BumpClient-4A2ADD525826BE6B.o) 
"_kCLLocationAccuracyBest", referenced from: 
    -[BumpClient init] in libBump.a(BumpClient-4A2ADD525826BE6B.o) 
"_AudioServicesCreateSystemSoundID", referenced from: 
    -[BumpDetector init] in libBump.a(BumpDetector.o) 
"_AudioServicesPlaySystemSound", referenced from: 
    -[BumpDetector init] in libBump.a(BumpDetector.o) 
    -[BumpDetector playBumpSound] in libBump.a(BumpDetector.o) 
ld: symbol(s) not found for architecture i386 
clang: error: linker command failed with exit code 1 (use -v to see invocation) 

我有libBump.a和BumpClient.H和檢查框架是鏈接, libBump包括

回答

1

看起來你是不是鏈接到libBump.a依賴於框架。例如。 _CFHostCreateWithName從CoreServices框架和_AudioServicesPlaySystemSound從AudioToolbox框架。