草庐IT

iphone - 将项目移动到 xcode 4 会出现“Apple Mach-O 链接器 (Id) 错误

coder 2024-01-17 原文

我升级到 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

最佳答案

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

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

有关iphone - 将项目移动到 xcode 4 会出现“Apple Mach-O 链接器 (Id) 错误的更多相关文章

  1. ruby - 如何在 buildr 项目中使用 Ruby 代码? - 2

    如何在buildr项目中使用Ruby?我在很多不同的项目中使用过Ruby、JRuby、Java和Clojure。我目前正在使用我的标准Ruby开发一个模拟应用程序,我想尝试使用Clojure后端(我确实喜欢功能代码)以及JRubygui和测试套件。我还可以看到在未来的不同项目中使用Scala作为后端。我想我要为我的项目尝试一下buildr(http://buildr.apache.org/),但我注意到buildr似乎没有设置为在项目中使用JRuby代码本身!这看起来有点傻,因为该工具旨在统一通用的JVM语言并且是在ruby中构建的。除了将输出的jar包含在一个独特的、仅限ruby​​

  2. ruby-on-rails - 项目升级后 Pow 不会更改 ruby​​ 版本 - 2

    我在我的Rails项目中使用Pow和powifygem。现在我尝试升级我的ruby​​版本(从1.9.3到2.0.0,我使用RVM)当我切换ruby​​版本、安装所有gem依赖项时,我通过运行railss并访问localhost:3000确保该应用程序正常运行以前,我通过使用pow访问http://my_app.dev来浏览我的应用程序。升级后,由于错误Bundler::RubyVersionMismatch:YourRubyversionis1.9.3,butyourGemfilespecified2.0.0,此url不起作用我尝试过的:重新创建pow应用程序重启pow服务器更新战俘

  3. ruby - 如何在 Lion 上安装 Xcode 4.6,需要用 RVM 升级 ruby - 2

    我实际上是在尝试使用RVM在我的OSX10.7.5上更新ruby,并在输入以下命令后:rvminstallruby我得到了以下回复:Searchingforbinaryrubies,thismighttakesometime.Checkingrequirementsforosx.Installingrequirementsforosx.Updatingsystem.......Errorrunning'requirements_osx_brew_update_systemruby-2.0.0-p247',pleaseread/Users/username/.rvm/log/138121

  4. ruby-on-rails - 新 Rails 项目 : 'bundle install' can't install rails in gemfile - 2

    我已经像这样安装了一个新的Rails项目:$railsnewsite它执行并到达:bundleinstall但是当它似乎尝试安装依赖项时我得到了这个错误Gem::Ext::BuildError:ERROR:Failedtobuildgemnativeextension./System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/rubyextconf.rbcheckingforlibkern/OSAtomic.h...yescreatingMakefilemake"DESTDIR="cleanmake"DESTDIR="

  5. Ruby 从大范围中获取第 n 个项目 - 2

    假设我有这个范围:("aaaaa".."zzzzz")如何在不事先/每次生成整个项目的情况下从范围中获取第N个项目? 最佳答案 一种快速简便的方法:("aaaaa".."zzzzz").first(42).last#==>"aaabp"如果出于某种原因你不得不一遍又一遍地这样做,或者如果你需要避免为前N个元素构建中间数组,你可以这样写:moduleEnumerabledefskip(n)returnto_enum:skip,nunlessblock_given?each_with_indexdo|item,index|yieldit

  6. ruby - 使用 rbenv 和 ruby​​-build 构建 ruby​​ 失败,出现 undefined symbol : SSLv2_method - 2

    我正在尝试在配备ARMv7处理器的SynologyDS215j上安装ruby​​2.2.4或2.3.0。我用了optware-ng安装gcc、make、openssl、openssl-dev和zlib。我根据README中的说明安装了rbenv(版本1.0.0-19-g29b4da7)和ruby​​-build插件。.这些是随optware-ng安装的软件包及其版本binutils-2.25.1-1gcc-5.3.0-6gconv-modules-2.21-3glibc-opt-2.21-4libc-dev-2.21-1libgmp-6.0.0a-1libmpc-1.0.2-1libm

  7. ruby - Rails -- :id attribute? 所需的数据库索引 - 2

    因此,当我遵循MichaelHartl的RubyonRails教程时,我注意到在用户表中,我们为:email属性添加了一个唯一索引,以提高find的效率方法,因此它不会逐行搜索。到目前为止,我们一直在根据情况使用find_by_email和find_by_id进行搜索。然而,我们从未为:id属性设置索引。:id是否自动索引,因为它在默认情况下是唯一的并且本质上是顺序的?或者情况并非如此,我应该为:id搜索添加索引吗? 最佳答案 大多数数据库(包括sqlite,这是RoR中的默认数据库)会自动索引主键,对于RailsMigration

  8. ruby - 如何在 Ruby 字符串中插入项目符号字符? - 2

    我正在尝试创建一个带有项目符号字符的Ruby1.9.3字符串。str="•"+"helloworld"但是,当我输入它时,我收到有关非ASCII字符的语法错误。我该怎么做? 最佳答案 你可以把Unicode字符放在那里。str="\u2022"+"helloworld" 关于ruby-如何在Ruby字符串中插入项目符号字符?,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com/questions/1195

  9. ruby - 在 Rails 项目中测试本地版本的 gem - 2

    我的Rails站点使用了一个确实不是很好的gem。每次我需要做一些新的事情时,我最终不得不花费与向实际Rails项目添加代码一样多的时间来为gem添加功能。但我不介意,我将我的Gemfile设置为指向我的gem的GitHub分支(我尝试提交PR,但维护者似乎已经下台)。问题是我真的没有找到一种合理的方法来测试我添加到gem的新东西。在railsc中测试它会特别好,但我能想到的唯一方法是a)更改~/.rvm/gems/.../foo。rb,这看起来不对或者b)升级版本,推送到Github,然后运行​​bundleup,这除了耗时之外显然是一场灾难,因为我不确定我所做的promise是否正

  10. ruby - 为什么 return 关键字会导致我的 'if block' 出现问题? - 2

    下面的代码工作正常:person={:a=>:A,:b=>:B,:c=>:C}berson={:a=>:A1,:b=>:B1,:c=>:C1}kerson=person.merge(berson)do|key,oldv,newv|ifkey==:aoldvelsifkey==:bnewvelsekeyendendputskerson.inspect但是如果我在“ifblock”中添加return,我会得到一个错误:person={:a=>:A,:b=>:B,:c=>:C}berson={:a=>:A1,:b=>:B1,:c=>:C1}kerson=person.merge(berson

随机推荐