Using g++ on OSX Lion, ld: unknown option: -no_compact_unwind

匆匆过客 提交于 2019-12-06 15:21:23

If you want to use the latest version of GCC (4.7) by command line on Mac OS X Lion, I have a better solution.

Install MacPorts (you can download the source code and compile it or download the pkg installer):

http://www.macports.org/install.php

Installed MacPort, open the Terminal and type (you need the root password)

sudo port selfupdate

for updating the port tree. Then type

sudo port install gcc47 +universal

This command will install the GCC 4.7 compiler on your Mac (this compilation will take a lot of time, be patient). Now you have your GCC 4.7 compiler accessible by the command line under the name

gcc-mp-4.7

(use g++-mp-4.7for C++ compilation). You have also the new C++11 standard adding the option

g++-mp-4.7 -std=c++11
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!