2012-06-27 3 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 프레임 워크입니다.