YIFEIYANG 易飞扬的博客

5十二/0946

iPhone开发入门(3)—Linux上构筑iPhone OS3.1.2开发环境

  • 博主:易飞扬
  • 原文链接 : http://www.yifeiyang.net/iphone-development-introduction-3-linux-development-environment-on-the-build-iphone-os3-1-2/
  • 转载请保留上面文字。


  • iPhone开发入门(3)—Linux上构筑iPhone OS3.1.2开发环境

    第一回我们介绍了开发iPhone应用程序标准的环境配置是基于intel Mac的。虽说现在Mac很便宜,但是仍然大部分人仍然在用windows和linux系统,今天就介绍一下在linux上建立iPhone开发系统。这里采用最新的SDK版本3.1.2(截至到2009/12/01)。

    这回主要介绍linux下的安装,配置方法,windows(Cygwin)的配置可以参考这里

    我的HOST机器环境如下:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    $ uname -a
    Linux localhost.localdomain 2.6.18-1.2798.fc6 #1 SMP Mon Oct 16 14:54:20 EDT 2006 i686 i686 i386 GNU/Linux
    
    $ gcc -v
    Using built-in specs.
    Target: i386-redhat-linux
    config option: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --enable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=i386-redhat-linux
    thread model: posix
    gcc version 4.1.2 20070626 (Red Hat 4.1.2-13)

    需要准备的东东:

    许多网站都介绍过了,这里也使用 toolchain 来建立环境。参考 iphonedevonlinux

    checkout toolchain

    1
    2
    3
    4
    5
    6
    7
    8
    $ mkdir ~/toolchain
    $ cd ~/toolchain
    $ svn checkout http://iphonedevonlinux.googlecode.com/svn/trunk/ ./
    
    # 拷贝SDK,firmware文件
    $ mkdir -p files/firmware
    $ mv ./iphone_sdk_3.1.2_with_xcode_3.1.4__leopard__9m2809.dmg ./files/
    $ mv ./iPhone1,2_3.1.2_7D11_Restore.ipsw ./files/firmware/

    今天(2010/2/9)更新的toolchain已经对应3.1.2版本的SDK了,所以大家不用再给他打补丁了。(多谢网友wzhao)

    ※ 如果遇到"We need the decryption key for 018-6028-014.dmg."的问题,可以将toolchain.sh中的
    DECRYPTION_KEY_SYSTEM=$.....    替换为 DECRYPTION_KEY_SYSTEM="a8a886d56011d2d98b190d0a498f6fcac719467047639cd601fd53a4a1d93c24e1b2ddc6"

    因为checkout 下来的toolchain是针对3.0版本的,直接不能使用,所以需要打个补丁。这里下载补丁,然后在toolchain目录下:

    1
    2

    $ patch < toolchain.sh.patch
    $ chmod u+x toolchain.sh

    安装/编译

    本来执行 ./toolchain.sh all 后会全部给安装和编译的,但是实际上有很多问题,所以我们还是一步一步地来。

    1
    2
    3
    4
    5
    6
    7
    8
    # 第一步没有什么问题
    $ ./toolchain.sh headers
    # 第二步也顺利通过
    $ ./toolchain.sh firmware
    # 第三步也挺顺利
    $ ./toolchain.sh darwin_sources
    # 最后一步,这一步需要注意了
    $ ./toolchain.sh build

    执行最后一步编译gcc-4.2-iphone,在链接的时候会出现以下的错误:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    ld: library not found for -lc
    collect2: ld returned 1 exit status
    make[3]: *** [libgcc_s.dylib] error 1
    ....
    make[2]: *** [stmp-multilib] error 2
    rm gcov.pod fsf-funding.pod gfdl.pod gpl.pod cpp.pod gcc.pod
    ....
    make[1]: *** [all-gcc] error 2
    make[1]:leaving dir `/home/xxx/toolchain/toolchain/bld/gcc-4.2-iphone'
    make: *** [all] error 2
    

    解决它很简单,在toolchain目录下执行:

    cp ./sdks/iPhoneOS3.1.2.sdk/usr/lib/libSystem.B.dylib ./toolchain/bld/gcc-4.2-iphone/gcc/libc.dylib

    接下来在执行一次 ./toolchain.sh build 就可以了。最后出现下面的画面就是成功了。

    It seems like the toolchain built!

    最后你可以执行 ./toolchain.sh clean 删除编译过程中的文件和 SDK 等文件,你也可以不这么做。

    测试

    接下来,借可以先试试 toolchain/apps/ 下面的测试代码 HelloToolchain。

    编译的过程中可能出现的问题有以下几个::

    1. 找不到编译器文件 arm-apple-darwin9-gcc

    如果直接在HelloToolchain目录下 make。很可能提示,没有 arm-apple-darwin9-gcc 等命令。这是因为没有设置编译器路径的原因。将下面的语句放入 /etc/profile 内(针对所有用户),或者 .bash_profile 文件中就可以了。

    export PATH=/home/xxx/toolchain/toolchain/pre/bin:$PATH

    2. 编译过程中提示Frameworks,或头文件找不到

    Classes/ClockAppDelegate.m:10:38: error: AVFoundation/AVFoundation.h: no such file or directory
    make: *** [Classes/ClockAppDelegate.o] Error 1

    或者是连接的时候提示:

    ld: library not found for -lobjc
    collect2: ld returned 1 exit status
    make: HelloWorldFirst? Error 1

    首先检查你的makefile文件是否配置好了库文件和头文件路径,比如像是以下的设置:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    # iPhone SDK path
    IPHONESDK = /home/xxx/toolchain/toolchain/sys
    # include path (SDK)
    INCPATH += -I"$(IPHONESDK)/usr/include"
    # include path (gcc)
    INCPATH += -I"$(IPHONESDK)/usr/include/gcc/darwin/4.2"
    
    CFLAGS  += $(INCPATH) \
    ...
    
    LDFLAGS += -L"$(IPHONESDK)/usr/lib"
    LDFLAGS += -F"$(IPHONESDK)/System/Library/Frameworks"
    LDFLAGS += -F"$(IPHONESDK)/System/Library/PrivateFrameworks"
    
    CFLAGS += -F"$(IPHONESDK)/System/Library/Frameworks"
    CFLAGS += -F"$(IPHONESDK)/System/Library/PrivateFrameworks"

    如果还是不行,下面有两个方法让你得到最新(3.1.2)的版本库和头文件:

    方法1

    这里下载dyldcache,用scp等工具将其传送到iPhone上,然后执行:

    iPhone$ ./dyldcache /System/Library/Caches/com.apple.dyld/dyld_shared_cache_armv6

    大概解压后有4GB左右的文件,请注意iPhone剩余的容量大小。解压完毕后将 ./out 目录下的文件拷贝到linux上的./toolchain/sys/usr/lib 目录下。

    方法2

    如果你还没有iPhone设备,那么可以按照以下的方法由sdk文件中提取库文件。

    1. 在这里下载HFSExplorer工具。(windows下使用)

    2. 用HFSExplorer打开SDK文件(.dmg文件),在Packages目录下将iPhoneSDKHeadersAndLibs.pkg文件解压到某一目录下。然后拷贝到linux下,比如这里拷贝到/tmp下。

    3. 执行以下命令,加压该数据包:

    1
    2
    3
    $ cd /tmp
    $ xar -xf iPhoneSDKHeadersAndLibs.pkg Payload
    $ zcat Payload | cpio -i

    完成之后,在/tmp目录下会生成几个子目录,这里我们需要的是Platforms目录下的东东。将 ./Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.2.sdk 目录与其子目录拷贝到toolchain的sdks目录下就可以了。

    1
    $ cp -rp ./Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.2.sdk /home/xxx/toolchain/sdks/

    注意 toolchain/sdks/ 目录下已经有 iPhoneOS3.1.2.sdk 目录了,完整覆盖它。通过以上修改后,刚才的 makefile 中的SDK路径需要修改一下,像是下面的样子。

    1
    2
    3
    # iPhone SDK path
    IPHONESDK = /home/xxx/toolchain/sdks/iPhoneOS3.1.2.sdk
    ...

    接下来,可以编译一下自己的程序,上机测试了。别忘了用ldid签名哦!。比如HelloToolchain是:

    1
    ldid -S HelloToolchain_

    toolchain for iPhone SDK 3.1.2

    toolchain for iPhone SDK 3.1.2

    相关文章

    喜欢这个文章吗?

    考虑订阅我们的RSS Feed吧!

    评论 (46) 引用 (0)
    1. 你好!请问在测试中出现你所述的ld问题具体如何解决,按照您的方法,我更改了hellotoolchain的makefile,因为它里面没有过的的涉及LDFLAGS += -F”$(IPHONESDK)/System/Library/PrivateFrameworks”之类,但是更改后报错如下:
      administrator@ubuntu:~/toolchain/apps/HelloToolchain$ make
      arm-apple-darwin9-gcc -L”/home/administrator/toolchain/sdks/iPhoneOS3.1.2.sdk/usr/lib” -F”/home/administrator/toolchain/sdks/iPhoneOS3.1.2.sdk/System/Library/Frameworks” -F”/home/administrator/toolchain/sdks/iPhoneOS3.1.2.sdk/System/Library/PrivateFrameworks” -o HelloToolchain HelloToolchain.o
      Undefined symbols:
      “__objc_empty_vtable”, referenced from:
      _OBJC_METACLASS_$_HelloToolchain in HelloToolchain.o
      _OBJC_CLASS_$_HelloToolchain in HelloToolchain.o
      …..
      ld: symbol(s) not found
      collect2: ld 返回 1
      make: *** [HelloToolchain] 错误 1
      请问对于这种情况应该如何处理,谢谢!

    2. ld: symbol(s) not found
      collect2: ld 返回 1
      make: *** [HelloToolchain] 错误 1

    3. 在你的makefile中添加下面的语句:

      LD = arm-apple-darwin9-gcc

      就是说用gcc来代替原有的arm-apple-darwin9-ld连接器。

    4. 你好 在./toolchain.sh build时;
      Build cctools-iPhone时
      出现错误
      Build &install failed.Check make.log and install.log
      在/root/toolchain/toolchain/bld/cctools-iphone/make.log文件夹里有错误提示:
      cc1plus: warning: unrecognized command line option “-Wno-long-double”
      make[1]: *** [ld.o] 错误 1
      make[1]:正在离开目录 `/root/toolchain/toolchain/bld/cctools-iphone/ld64′
      make: *** [ld64] 错误 2
      请高手帮忙解决

    5. 你可以注释掉toolchain.sh文件中的
      –enable-ld64
      一行,再编译一下试试。

    6. 怎么注释了 谢谢 本人比较菜

    7. 解决了 谢谢

    8. 你好 ,又遇到问题了
      Building gcc-4.2-iphone…
      Build progress logged to: /root/toolchain/toolchain/bld/gcc-4.2-iphone/make.log
      Build & install failed. Check make.log and install.log

      checking whether fgetc_unlocked is declared… make[3]: 正在进入目录 `/root/toolchain/toolchain/bld/gcc-4.2-iphone/libiberty/testsuite’
      make[3]: 没有什么可以做的为 `all’。

    9. 你好 ,又遇到问题了
      Building gcc-4.2-iphone…
      Build progress logged to: /root/toolchain/toolchain/bld/gcc-4.2-iphone/make.log
      Build & install failed. Check make.log and install.log

      checking whether fgetc_unlocked is declared… make[3]: 正在进入目录 `/root/toolchain/toolchain/bld/gcc-4.2-iphone/libiberty/testsuite’
      make[3]: 没有什么可以做的为 `all’。
      checking whether fread_unlocked is declared… yes
      make[1]: *** [configure-gcc] 错误 1
      make[1]: *** 正在等待未完成的任务…

    10. 打开make.log看看是什么具体的错误信息。
      大体上看,是你的系统中缺少了什么东西。

    11. 编译具体要按些什么软件啊 我安了很多了 我用的是Ubuntu9.10 大侠指点啊
      马上就要成功了 不能功亏一篑啊

    12. 问题是出在Configuring in ./gcc的配置中,你打开make.log,看看具体什么错误

    13. 错误提示 是 缺少那个被注释了的文件ld64

    14. 1. 首先x64需要g++-4.3-multilib gcc-4.3-multilib gobjc-4.3-multilib

      2. 将上面注释掉的–enable-ld64用–disable-ld64替代后,再编译一下试试。

      3. 如果还是不行,可以参考下面的补丁:
      http://devs.openttd.org/~truebrain/compile-farm/odcctools_ld64.patch

      使用说明在这里:
      http://devs.openttd.org/~truebrain/compile-farm/apple-darwin9.txt

      我手上没有x64的机子,也没有Ubuntu的系统,你需要自己试试了。

    15. To mj:
      不知道你用的什么版本的gcc,Wno-long-double 这个标记在比较新的gcc里是不支持的。
      还有好好看看make.log里的具体错误,尤其是最后错误提示之前的部分,不妨搜搜error看看

    16. hi,能发一份打过不定的toolchain.sh 文件给我吗 ?我这边打完不定后报错呀。
      zhaowei@zhaowei-ubuntu:~/toolchain$ sudo patch < toolchain.sh.patch
      patching file toolchain.sh
      Reversed (or previously applied) patch detected! Assume -R? [n] y
      Hunk #1 succeeded at 25 with fuzz 2.
      Hunk #2 FAILED at 121.
      Hunk #3 succeeded at 354 (offset 3 lines).
      Hunk #4 FAILED at 521.
      Hunk #5 FAILED at 903.
      3 out of 5 hunks FAILED — saving rejects to file toolchain.sh.rej

    17. 我终于搞定了编译,It seems like the toolchain built!

      谢谢你的这篇文章,随便说一句,在失败后我安装了官方列从的所有包,不用打那个不定哦,官方现在已经是3。1的了。

    18. To wzhao:

      是啊,刚才更新了iphonedevonlinux上的文件toolchain.sh已经可以支持3.1.2版本的SDK了,所以大家不用给它打补丁了,等会儿我会更新文章的。

    19. 你好, 我照着教程做到
      ./toolchain.sh firmware

      这一步的时候就卡住了, 我是用 Vbox 里装的 ubuntu 9.10来装的, 能否帮忙看看,谢谢

      以下是错误信息:
      ./toolchain.sh firmware
      Preparing the environment
      Toolchain version: 3.1.2
      Building in: /home/free4machine/toolchain
      Environment is ready
      Extracting firmware files…
      Archive: /home/free4machine/toolchain/files/firmware/iPhone1,2_3.1.2_7D11_Restore.ipsw
      inflating: /home/free4machine/toolchain/tmp/Restore.plist
      Firmware Details
      Device Class: iPhone
      Product Version: 3.1.2
      Build Version: 7D11
      Restore RamDisk: 018-6136-014.dmg
      Restore Image: 018-6028-014.dmg
      Board Config: n82ap
      Unzipping 018-6028-014.dmg…
      Archive: /home/free4machine/toolchain/files/firmware/iPhone1,2_3.1.2_7D11_Restore.ipsw
      inflating: /home/free4machine/toolchain/tmp/018-6028-014.dmg
      We need the decryption key for 018-6028-014.dmg.
      I’m going to try to fetch it from http://www.theiphonewiki.com/wiki/index.php?title=Firmware….

      Sorry, no decryption key for system partition found!

    20. 问题好像是你安装的时候,机器不能上网。最新的./toolchain.sh中关于018-6028-014.dmg的解密好像是通过wget www.theiphonewiki.com的内容来解决的。你可以不理它,直接硬解码。具体的做法是在./toolchain.sh文件中:

      DECRYPTION_KEY_SYSTEM=`wget ….
      替换为
      DECRYPTION_KEY_SYSTEM=”a8a886d56011d2d98b190d0a498f6fcac719467047639cd601fd53a4a1d93c24e1b2ddc6″

      应该就可以了。具体你可以看我以前提供的patch文件(链接文中有)。

    21. 谢谢, 把 DECRYPTION_KEY_SYSTEM 替换后 通过了。

      再执行 ./toolchain.sh build 时, 出现以下信息:

      Building gcc-4.2-iphone…
      Build progress logged to: /home/free4machine/toolchain/toolchain/bld/gcc-4.2-iphone/make.log
      Build & install failed. Check make.log and install.log

      然后看 gcc-4.2-iphone/make.log :

      arm-apple-darwin9-ranlib: file: kext/libgcc.a(_bb_init_func.o) has no symbols
      arm-apple-darwin9-ranlib: file: kext/libgcc.a(_floatdidf.o) has no symbols
      arm-apple-darwin9-ranlib: file: kext/libgcc.a(_floatdisf.o) has no symbols
      arm-apple-darwin9-ranlib: file: kext/libgcc.a(_floatundidf.o) has no symbols
      arm-apple-darwin9-ranlib: file: kext/libgcc.a(_floatundisf.o) has no symbols
      arm-apple-darwin9-ranlib: file: kext/libgcc.a(_floatunssidfvfp.o) has no symbols
      arm-apple-darwin9-ranlib: file: kext/libgcc.a(_floatunssisfvfp.o) has no symbols
      /home/free4machine/toolchain/toolchain/pre/bin/arm-apple-darwin9-ld: /home/free4machine/toolchain/toolchain/sys/usr/lib/libc.dylib unknown flags (type) of section 4 (__TEXT,__dof_magmalloc) in load command 0
      collect2: ld returned 1 exit status
      make[3]: *** [libgcc_s.dylib] Error 1
      make[3]: Leaving directory `/home/free4machine/toolchain/toolchain/bld/gcc-4.2-iphone/gcc’
      make[2]: *** [stmp-multilib] Error 2
      make[2]: Leaving directory `/home/free4machine/toolchain/toolchain/bld/gcc-4.2-iphone/gcc’
      make[1]: *** [all-gcc] Error 2
      make[1]: Leaving directory `/home/free4machine/toolchain/toolchain/bld/gcc-4.2-iphone’
      make: *** [all] Error 2

      然后我也做了这一步

      cp ./sdks/iPhoneOS3.1.2.sdk/usr/lib/libSystem.B.dylib ./toolchain/bld/gcc-4.2-iphone/gcc/libc.dylib

      还是报这个错,难道是 libgcc_s.dylib 这个库没有装上?

    22. 文中已经给出了解决方法,你好像没有仔细看啊。:(
      执行下面的命令。
      cp ./sdks/iPhoneOS3.1.2.sdk/usr/lib/libSystem.B.dylib ./toolchain/bld/gcc-4.2-iphone/gcc/libc.dylib

    23. 我这里toolchain.sh执行到
      git clone -n git://git.saurik.com/llvm-gcc-4.2 “${GCC_DIR}”
      的时候就会被对方refused,无法取到llvm-gcc-4.2,请问这可能是什么原因,是server关掉了还是限制国内IP?
      之前的wget http://www.theiphonewiki.com也不行,被封了,用了代理就可以了,但是git这个改成http代理也不行,真是郁闷啊

    24. To huawuya
      最近,大家好像都遇到了这个问题,你可以看这里
      http://code.google.com/p/iphonedevonlinux/wiki/Installation
      等待答案。

    25. 应该是服务器的问题,今天可以用git得到llvm-gcc-4.2了

    26. 你好,编译过程中被卡在了这里:
      /home/kaka/toolchain/toolchain/pre/bin/arm-apple-darwin9-ld: /home/kaka/toolchain/toolchain/sys/usr/lib/libc.dylib unknown flags (type) of section 4 (__TEXT,__dof_magmalloc) in load command 0

      环境是ubuntu 32位

      已经按文章中打过补丁了

      cp ./sdks/iPhoneOS3.1.2.sdk/usr/lib/libSystem.B.dylib ./toolchain/bld/gcc-4.2-iphone/gcc/libc.dylib

    27. 这里给出了两种解决方案,你可以试试。

    28. vividness@vividness-laptop:~/toolchain$ ./toolchain.sh headers
      Preparing the environment
      Toolchain version: 3.1.2
      Building in: /home/vividness/toolchain
      The following commands are missing: xar
      You may need to install additional software for them using your package manager.

      这个怎么解决阿

    29. sudo apt-get install xar

    30. vividness@vividness-laptop:~/toolchain$ ./toolchain.sh firmware
      ./toolchain.sh: line 532: 在未预料的“}”附近出现语法错误
      ./toolchain.sh: line 532: ` BEGIN { IGNORECASE = 1; }’

    31. 问题好像是你安装的时候,机器不能上网。最新的./toolchain.sh中关于018-6028-014.dmg的解密好像是通过wget www.theiphonewiki.com的内容来解决的。你可以不理它,直接硬解码。具体的做法是在./toolchain.sh文件中:

      DECRYPTION_KEY_SYSTEM=`wget ….
      替换为
      DECRYPTION_KEY_SYSTEM=”a8a886d56011d2d98b190d0a498f6fcac719467047639cd601fd53a4a1d93c24e1b2ddc6″

      应该就可以了。具体你可以看我以前提供的patch文件(链接文中有)。

      按照你说的办法弄了 还是停在
      We need the decryption key for .
      I’m going to try to fetch it from http://www.theiphonewiki.com/wiki/index.php?title=Firmware….

    32. 请你参照文章中的补丁文件,如果强制写了 DECRYPTION_KEY_SYSTEM=“a8a8 …
      的话,连接www.theiphonewiki.com的语句都被注释掉了。

    33. We need the decryption key for .
      I’m going to try to fetch it from http://www.theiphonewiki.com/wiki/index.php?title=Firmware….
      I found it!
      Mounting …
      Decrypting tmp…
      就是过不去阿
      Failed to decrypt tmp!

    34. 请仔细看这个补丁

    35. 请问 git clone -n git://git.saurik.com/llvm-gcc-4.2 “${GCC_DIR}”这个问题可以解决了吗?我也遇到 了?服务器问题?

    36. 博主 在不 还是不行 把你的toolchain.sh 给我一份好么

    37. checking whether to place generated files in the source directory… no
      configure: error: cannot execute: /home/vividness/toolchain/toolchain/pre/bin/arm-apple-darwin9-ld: check –with-ld or env. var. DEFAULT_LINKER
      no
      checking whether vasprintf is declared… (cached) no
      checking whether clearerr_unlocked is declared… make[1]: *** [configure-gcc] 错误 1
      make[1]: *** 正在等待未完成的任务….
      yes
      checking whether feof_unlocked is declared… yes
      checking whether ferror_unlocked is declared… yes
      checking whether fflush_unlocked is declared… yes
      checking whether fgetc_unlocked is declared… yes
      checking whether fgets_unlocked is declared… no
      checking whether fileno_unlocked is declared… yes
      checking whether fprintf_unlocked is declared… no
      checking whether fputc_unlocked is declared… yes
      checking whether fputs_unlocked is declared… no
      checking whether fread_unlocked is declared… yes
      checking whether fwrite_unlocked is declared… yes
      checking whether getchar_unlocked is declared… yes
      checking whether getc_unlocked is declared… yes
      checking whether putchar_unlocked is declared… yes
      checking whether putc_unlocked is declared… yes
      checking for an ANSI C-conforming const… (cached) yes
      checking for sys/mman.h… (cached) yes
      checking for mmap… yes
      checking whether read-only mmap of a plain file works… yes
      checking whether mmap from /dev/zero works… yes
      checking for MAP_ANON(YMOUS)… yes
      checking whether mmap with MAP_ANON(YMOUS) works… yes
      checking whether to enable maintainer-specific portions of Makefiles… no
      updating cache ../config.cache
      configure: creating ./config.status
      config.status: creating Makefile
      config.status: creating mkheaders.almost
      config.status: creating config.h
      config.status: config.h is unchanged
      make[1]:正在离开目录 `/home/vividness/toolchain/toolchain/bld/gcc-4.2-iphone’
      make: *** [all] 错误 2

    38. 你好 在./toolchain.sh build时;
      Build cctools-iPhone时
      出现错误
      Build &install failed.Check make.log and install.log
      在/root/toolchain/toolchain/bld/cctools-iphone/make.log文件夹里有错误提示:
      cc1plus: warning: unrecognized command line option “-Wno-long-double”
      make[1]: *** [ld.o] 错误 1
      make[1]:正在离开目录 `/root/toolchain/toolchain/bld/cctools-iphone/ld64′
      make: *** [ld64] 错误 2
      请高手帮忙解决

    39. 你好 我在fedora12下出现这样的错误,请问怎样解决啊?
      ./toolchain.sh headers
      …….
      which: no xar in (/usr/lib/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib/ccache:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/sam/bin)
      The following commands are missing: xar
      You may need to install additional software for them using your package manager.

    40. configure: error: cannot execute: /usr/local/bin/arm-apple-darwin9-ld: check –with-ld or env. var. DEFAULT_LINKER
      make[1]: *** [configure-gcc] 错误 1
      make[1]: *** 正在等待未完成的任务….

    41. vividness@vividness-laptop:~/iphone/toolchain/apps/HelloToolchain$ ldid -S HelloToolchain
      No command ‘ldid’ found, did you mean:
      Command ‘lid’ from package ‘libuser’ (universe)
      Command ‘lid’ from package ‘id-utils’ (universe)
      Command ‘ldd’ from package ‘libc-bin’ (main)
      Command ‘ldmd’ from package ‘ldc’ (universe)
      ldid: command not found

    42. 你好,请问出现这个问题
      /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.3/libstdc++.so when searching for -lstdc++
      /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.3/libstdc++.a when searching for -lstdc++
      /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.3/libstdc++.so when searching for -lstdc++
      /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.3/libstdc++.a when searching for -lstdc++
      /usr/bin/ld: cannot find -lstdc++
      collect2: ld returned 1 exit status
      make[1]: *** [ld64] 错误 1
      make[1]:正在离开目录 `/home/xiaoxiao/toolchain/toolchain/bld/cctools-iphone/ld64′
      make: *** [ld64] 错误 2

      是缺少哪个文件应该放到哪里?
      还有~我没有./toolchain/bld/gcc-4.2-iphone/文件夹,为什么?~正常么?~谢谢了~刚接触这个~~

    43. 上边的问题解决,toolchain必须在基于32位编译~

      做个链接
      ~$ cd /usr/lib32
      ~$ sudo ln libstdc++.so.6.0.13 libstdc++.so

      搞定~

    44. ubuntu下出现ld64的问题的原因是 ubuntu的gcc版本太高。
      只要把toolchain.sh里的
      CFLAGS=”-m32″ LDFLAGS=”-m32″ “${CCTOOLS_DIR}”/configure \
      –target=”${TARGET}” \
      –prefix=”$PREFIX” \
      –enable-ld64
      改成
      CFLAGS=”-m32″ LDFLAGS=”-m32″ CC=”gcc-4.3″ CXX=”g++-4.3″ “${CCTOOLS_DIR}”/configure \
      –target=”${TARGET}” \
      –prefix=”$PREFIX” \
      –enable-ld64
      就ok了
      In detail : http://code.google.com/p/iphonedevonlinux/issues/detail?id=25

    45. 你好,请问在./toolchain.sh headers 时,出现gzip: stdin: not in gzip format
      tar: Child returned status 1
      tar: 由于前面延迟的错误而退出
      Failed to get and extract dmg2img-1.6.1 Check errors.
      You have new mail in /var/spool/mail/root
      这个问题怎么解决? 谢谢!

    46. 从错误提示看,文件的后缀是 .gz,但实际是 .tar 的文件,把出错的地方的文件改为 .tar 或者修改toolchain.sh中相应地方的命令应该就可以了。


    发表评论


    还没有引用.














    相册

    ESC_021

    日历

    2012年二月
    « 一    
     12345
    6789101112
    13141516171819
    20212223242526
    272829  

    页面

    分类目录

    博客目录

    标签




    free counters