3

I'm having some hard time with the iOS GameCenter I'm following some tutorials on youtube 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
Cœur
  • 37,241
  • 25
  • 195
  • 267
Felipe
  • 498
  • 10
  • 29

2 Answers2

7

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.
Jonathan.
  • 53,997
  • 54
  • 186
  • 290
  • JONATHAN, THANK YOU VERY MUCH. ACTUALLY, I HAD THE GAMEKIT IN MY PROJECT BUT I "IMPORTED" IT IN A DIFFERENT WAY. SO I DELETED IT AND DID AS YOU SUGGESTED AND IT'S ROCKING. – Felipe Mar 23 '11 at 19:18
2

Did you add the GameKit.framework to your project?

picciano
  • 22,341
  • 9
  • 69
  • 82
  • If you're using Xcode 4 (unlike the YouTube tutorial) you'll add the framework in a little different way. See: http://stackoverflow.com/questions/3352664/how-to-add-existing-frameworks-in-xcode-4 – picciano Mar 22 '11 at 22:45
  • PICCIANO, YES. BUT I DID THE SAME PROCEDURE THE DUDE UNDER TOLD EXPLAINED AND NOW IT'S ERRORS WENT CLEAR AS A WISTLE. – Felipe Mar 23 '11 at 19:25