How to switch the GCC compiler on MAC (macports)

Source: Internet
Author: User

How to switch the GCC compiler on MAC (macports)

The method here is implemented through the PORT command option, so you need to install macports first. The specific installation steps are not mentioned. The command for switching to different GCC versions is as follows:
Run:
$ Sudo port select -- list gcc
Display:
Password:
Available versions for GCC:
Gcc42
Llvm-gcc42
Mp-gcc45)
None
Select the llvm-gcc42 as the compiler and execute:
$ Sudo port select -- set GCC llvm-gcc42.
Display:
Selecting 'llvm-gcc42' for 'gcc 'succeeded. 'llvm-gcc42' is now active.

Previous versions of macports used gcc_select to switch to the GCC version. However, today, I failed to execute the command. I found that gcc_select was canceled by voting on the official website and implemented by the Select parameter.

 

2

Http://stackoverflow.com/questions/810892/update-gcc-on-osxclick to open the link

 

 

$ Sudo port select -- list gcc

AvailableVersionsForGcc:Gcc42llvm-Gcc42mp-Gcc46none(Active)

 

To set GCC to the macports version:

$ Sudo port select -- set GCC mp-gcc46.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.