开发者

Moving project to xcode 4 gives "Apple Mach-O Linker (Id) Error

I upgraded to XCode 4 and one of my projects won't compile anymore. Has anyone had this problem? Full error stack below (slightly reformatted for legibility):

Ld /Users/stephen/Library/Developer/Xcode/开发者_开发知识库DerivedData/viewer-dsbfkuoythcgojfrsktxcccyfnuj/Build/Products/Debug-iphonesimulator/viewer.app/viewer normal i386
cd /Users/stephen/projects/Quipper/iPhone-viewer
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/g++-4.2 \
    -arch i386 \
    -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk \
    -L/Users/stephen/Library/Developer/Xcode/DerivedData/viewer-dsbfkuoythcgojfrsktxcccyfnuj/Build/Products/Debug-iphonesimulator \
    -L/Users/stephen/projects/Quipper/iPhone-viewer/AdMob \
    "-L/Users/stephen/projects/Quipper/iPhone-viewer/Twitter+OAuth/Libraries & Headers" \
    -L/Users/stephen/projects/Quipper/iPhone-viewer/FlurryLib \
    -F/Users/stephen/Library/Developer/Xcode/DerivedData/viewer-dsbfkuoythcgojfrsktxcccyfnuj/Build/Products/Debug-iphonesimulator \
    -filelist /Users/stephen/Library/Developer/Xcode/DerivedData/viewer-dsbfkuoythcgojfrsktxcccyfnuj/Build/Intermediates/viewer.build/Debug-iphonesimulator/viewer.build/Objects-normal/i386/viewer.LinkFileList \
    -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 \
    -framework CoreGraphics -framework CoreData -lAdMob -framework iAd \
    -framework StoreKit -framework MediaPlayer -lOAuth -lxml2.2 \
    -framework MessageUI -framework CoreLocation -framework QuartzCore \
    -framework CoreMedia -framework AVFoundation -framework SystemConfiguration \
    -framework CoreAudio -framework AudioToolbox -framework Foundation \
    -framework UIKit -lFlurry -framework OpenAL \
    -o /Users/stephen/Library/Developer/Xcode/DerivedData/viewer-dsbfkuoythcgojfrsktxcccyfnuj/Build/Products/Debug-iphonesimulator/viewer.app/viewer

ld: duplicate symbol _OBJC_IVAR_$_StartChallengeViewController.user_pack_id
    in /Users/stephen/Library/Developer/Xcode/DerivedData/viewer-dsbfkuoythcgojfrsktxcccyfnuj/Build/Intermediates/viewer.build/Debug-iphonesimulator/viewer.build/Objects-normal/i386/StartChallengeViewController-C52C140DA244D284.o
    and /Users/stephen/Library/Developer/Xcode/DerivedData/viewer-dsbfkuoythcgojfrsktxcccyfnuj/Build/Intermediates/viewer.build/Debug-iphonesimulator/viewer.build/Objects-normal/i386/StartChallengeViewController-469DDEB33F89F484.o
    for architecture i386
collect2: ld returned 1 exit status
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/g++-4.2 failed with exit code 1


You have declared a global iVar with an assigned value (e.g. int i = 2;) with the same name in 2 different classes, one of those classes being StartChallengeViewController. If cleaning the project (Cmd Shift K) doesn't help, try renaming one of the iVars to something else, or not giving it an initial value.


Try:

Cleaning the project

Setting Base SDK to latest iOS Setting Deployment Target to the iOS version you want to build for.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜