Replace GCC with GNU gcc in MacBook

Source: Internet
Author: User
Tags macbook

The MacBook is defined as clang, while the Orthodox GNU GCC can only use gcc-7 (gcc 7), however, if you modify the/usr/bin link, it is also prone to system errors because the Mac's toolchain and GCC (clang) are highly integrated, searching for , found that a master through the clever use of alias to solve the problem perfectly, but also can be in need, at any time undo.

under User directory, modify the. bash_profile file alias gcc="gcc-7"alias cc="  Gcc-7"alias G++="g++-7"alias C++=" c++-7 "

The original text is as follows: Https://apple.stackexchange.com/questions/99077/how-to-set-gcc-4-8-as-default-gcc-compiler

Thanks to the your help. I ended up just creating aliases within as ~/.bash_profile follows:

alias gcc=‘gcc-4.8‘alias cc=‘gcc-4.8‘alias g++=‘g++-4.8‘alias c++=‘c++-4.8‘

This was basically what Lyken suggested but easier to undo if necessary.

Reference article: http://blog.csdn.net/u010167269/article/details/51951582

Replace GCC with GNU gcc in MacBook

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.