• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

iphone - 将项目移动到 xcode 4 会出现“Apple Mach-O Linker (Id) Error

[复制链接]
菜鸟教程小白 发表于 2022-12-13 08:23:26 | 显示全部楼层 |阅读模式 打印 上一主题 下一主题

我升级到 XCode 4,我的一个项目将不再编译。有人遇到过这个问题吗?下面是完整的错误堆栈(为了便于阅读,稍微重新格式化):

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



Best Answer-推荐答案


您已在 2 个不同的类中声明了一个具有相同名称的分配值(例如 int i = 2;)的全局 iVar,其中一个是 StartChallengeViewController .如果清理项目(Cmd Shift K)没有帮助,请尝试将其中一个 iVar 重命名为其他名称,或者不给它一个初始值。

关于iphone - 将项目移动到 xcode 4 会出现“Apple Mach-O Linker (Id) Error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6634275/

回复

使用道具 举报

懒得打字嘛,点击右侧快捷回复 【右侧内容,后台自定义】
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关注0

粉丝2

帖子830918

发布主题
阅读排行 更多
广告位

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap