V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Kid
V2EX  ›  程序员

Q. 如何在 Mac OS X 下編譯、安裝 gcc?

  •  
  •   Kid · 2011-04-03 01:07:03 +08:00 · 6404 次点击
    这是一个创建于 4743 天前的主题,其中的信息可能已经有所发展或是发生改变。
    Configure 的時候總是說 GMP, MPFR, MPC 的 Library 版本不對。

    ./configure --prefix=/usr/local --target=i386-jos-elf --disable-werror --disable-libssp --disable-libmudflap --with-newlib --without-headers --enable-languages=c,c++ --with-gmp=/usr/local/ --with-mpfr=/usr/local --with-mpc=/usr/local

    [省略很多行]

    checking for the correct version of gmp.h... yes
    checking for the correct version of mpfr.h... yes
    checking for the correct version of mpc.h... yes
    checking for the correct version of the gmp/mpfr/mpc libraries... no
    configure: error: Building GCC requires GMP 4.2+, MPFR 2.3.1+ and MPC 0.8.0+.

    但是 /usr/local 裏面有新鮮編譯、安裝好的 GMP, MPFR, MPC,版本分別是 5.0.1, 3.0.0, 0.9。

    my-mac:gcc-4.5.1 me$ ls /usr/local/lib/
    ImageMagick-6.6.1 libmpc.2.dylib libmpfr.a
    libgmp.10.dylib libmpc.a libmpfr.dylib
    libgmp.a libmpc.dylib libmpfr.la
    libgmp.dylib libmpc.la
    libgmp.la libmpfr.4.dylib

    -- 這是一個典型的語言很貧乏的提問。
    3 条回复    1970-01-01 08:00:00 +08:00
    benzhe
        1
    benzhe  
       2011-04-03 01:13:22 +08:00
    –with-gmp=/usr/local/gmp-5.0.1 –with-mpfr=/usr/local/mpfr-3.0.0 –with-mpc=/usr/local/mpc-0.8.2

    自行替换目录
    Kid
        2
    Kid  
    OP
       2011-04-03 01:23:49 +08:00
    @benzhe
    /usr/local/ 下面根本沒有這些東西。
    如果你說的 gmp-5.0.1 這些是安裝目錄的話,那麼我的這些庫都是直接放在 /usr/local/ 裏面的。
    jjgod
        3
    jjgod  
       2011-04-03 01:40:23 +08:00
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5417 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 08:43 · PVG 16:43 · LAX 01:43 · JFK 04:43
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.