GameKit / GameCenter - I386

I am having difficulty with iOS GameCenter. I am following some youtube tutorials, but as soon as I finish the code I get this error:

Ld /Users/fgringo/Library/Developer/Xcode/DerivedData/Game-Center-Test-aggpqkxrazgvnseohuityqvchrnm/Build/Products/Debug-iphonesimulator/Game-Center-Test.app/Game-Center-Test normal i386
    cd /Users/fgringo/Documents/DEVELOPER/Game-Center-Test
    setenv MACOSX_DEPLOYMENT_TARGET 10.6
    setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-gcc-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk -L/Users/fgringo/Library/Developer/Xcode/DerivedData/Game-Center-Test-aggpqkxrazgvnseohuityqvchrnm/Build/Products/Debug-iphonesimulator -F/Users/fgringo/Library/Developer/Xcode/DerivedData/Game-Center-Test-aggpqkxrazgvnseohuityqvchrnm/Build/Products/Debug-iphonesimulator -F/Users/fgringo/Documents/DEVELOPER/Game-Center-Test -filelist /Users/fgringo/Library/Developer/Xcode/DerivedData/Game-Center-Test-aggpqkxrazgvnseohuityqvchrnm/Build/Intermediates/Game-Center-Test.build/Debug-iphonesimulator/Game-Center-Test.build/Objects-normal/i386/Game-Center-Test.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -framework UIKit -framework Foundation -framework CoreGraphics -framework GameKit -framework MediaPlayer -o /Users/fgringo/Library/Developer/Xcode/DerivedData/Game-Center-Test-aggpqkxrazgvnseohuityqvchrnm/Build/Products/Debug-iphonesimulator/Game-Center-Test.app/Game-Center-Test

ld: warning: ignoring file /Users/fgringo/Documents/DEVELOPER/Game-Center-Test/GameKit.framework/GameKit, missing required architecture i386 in file
ld: warning: ignoring file /Users/fgringo/Documents/DEVELOPER/Game-Center-Test/MediaPlayer.framework/MediaPlayer, missing required architecture i386 in file
Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_GKLocalPlayer", referenced from:
      objc-class-ref in GameCenterManager.o
  "_OBJC_CLASS_$_GKLeaderboard", referenced from:
      objc-class-ref in GameCenterManager.o
  "_OBJC_CLASS_$_GKScore", referenced from:
      objc-class-ref in GameCenterManager.o
  "_OBJC_CLASS_$_GKAchievement", referenced from:
      objc-class-ref in GameCenterManager.o
  "_OBJC_CLASS_$_GKPlayer", referenced from:
      objc-class-ref in GameCenterManager.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
+3
source share
2 answers

It looks like you have not added a GameKit framework to your project.

If you are using Xcode 3.2.x:

  • Right-click a group Frameworksin the file tree (to the left of the xcode window)
  • Press Addand then selectExisting Frameworks...
  • Scroll to GameKit.frameworkand double-click on it.

If you are using Xcode 4:

  • In the file tree, click on the project (item at the top)
  • Choose a target
  • Go to the tab Build Phasesin the main panel
  • Expand Link Binary with Libraries
  • Press button +
  • GameKit.framework .
+7

GameKit.framework ?

+2

All Articles