• 请不要在回答技术问题时复制粘贴 AI 生成的内容
Kid
V2EX  ›  程序员

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

  •  
  •   Kid · Apr 3, 2011 · 7291 views
    This topic created in 5525 days ago, the information mentioned may be changed or developed.
    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 replies    1970-01-01 08:00:00 +08:00
    benzhe
        1
    benzhe  
       Apr 3, 2011
    –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
       Apr 3, 2011
    @benzhe
    /usr/local/ 下面根本沒有這些東西。
    如果你說的 gmp-5.0.1 這些是安裝目錄的話,那麼我的這些庫都是直接放在 /usr/local/ 裏面的。
    jjgod
        3
    jjgod  
       Apr 3, 2011
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1461 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 16:54 · PVG 00:54 · LAX 09:54 · JFK 12:54
    ♥ Do have faith in what you're doing.