본문 바로가기

C/Objective C/ios

ios 빌드 오류(앱 GameCenter 기능 제외 후 생긴 오류)


오류 내용.

Undefined symbols for architecture armv7:
  "_OBJC_CLASS_$_GKLeaderboardViewController", referenced from:
      objc-class-ref in libiPhone-lib.a(GameCenter.o)
  "_OBJC_CLASS_$_GKScore", referenced from:
      objc-class-ref in libiPhone-lib.a(GameCenter.o)
  "_OBJC_CLASS_$_GKAchievement", referenced from:
      objc-class-ref in libiPhone-lib.a(GameCenter.o)
  "_OBJC_CLASS_$_GKAchievementDescription", referenced from:
      objc-class-ref in libiPhone-lib.a(GameCenter.o)
  "_OBJC_CLASS_$_GKLeaderboard", referenced from:
      objc-class-ref in libiPhone-lib.a(GameCenter.o)
  "_OBJC_CLASS_$_GKPlayer", referenced from:
      objc-class-ref in libiPhone-lib.a(GameCenter.o)
  "_GKErrorDomain", referenced from:
      GameCenter::CreateUserImage(UIImage*, NSError*) in libiPhone-lib.a(GameCenter.o)
  "_OBJC_CLASS_$_GKAchievementViewController", referenced from:
      objc-class-ref in libiPhone-lib.a(GameCenter.o)
  "_OBJC_CLASS_$_GKLocalPlayer", referenced from:
      objc-class-ref in libiPhone-lib.a(GameCenter.o)
ld: symbol(s) not found for architecture armv7

clang: error: linker command failed with exit code 1 (use -v to see invocation)

해결책.

It looks like you haven't added the GameKit framework to your project.
If your using Xcode 3.2.x:
  • Right click the Frameworks group/folder in the file tree (on the left of the xcode window)
  • Press Add, and then select Existing Frameworks...
  • Scroll to GameKit.framework and double click it
If your using Xcode 4:
  • In the file tree, click on the project (the item at the top)
  • Select your target
  • Go to the Build Phases tab on the main panel
  • Expand the Link Binary with Libraries
  • Press the + button
  • Scroll to the GameKit.framework and double click it.