how do i build gcc on a mac?

前端 未结 4 2266
一生所求
一生所求 2021-02-19 13:09

I\'d like to build the latest version of gcc on a mac. I have the latest xcode but I\'m looking for some of the c++0x features that are in more recent versions (the lambda funct

4条回答
  •  广开言路
    2021-02-19 13:51

    One option is to install MacPorts and install the gcc46 package:

    sudo port install gcc46
    

    Another option is to download the source code and build it as follows:

    tar xzvf gcc-4.6.0.tar.gz
    cd gcc-4.6.0
    ./configure
    make
    

    Note that GCC 4.6.0 requires as prerequisites GMP 4.2+, MPFR 2.3.1+, and MPC 0.8.0+. If ./configure fails, it's probably because you're missing one of these (though it should give you a helpful error message in any case).

    Building will take a while—likely several hours, depending on your hardware.

提交回复
热议问题