English 中文(简体)
• Mac升
原标题:Can t upgrade gcc on Mac

So this is after having dropped $30 for Mac OS 10.7 and having downloaded XCode 4.3.2. After installing the command line tools, the installed version of gcc is still 4.2.4. I need 4.7. I ve installed it and set the g++ link in /usr/bin to it. But when I try to compile any program via QtCreator, I get

未承认的指挥线选择-Xarch_x86_64

I found this discussed in a 3-year-old bug report here, but I really couldn t follow all the different shell commands etc. and my attempt to install liblastfm failed with the same error. The comment here,

The problem is that the GCC/G++ that is normally used to compile stuff on Macs is actually just a wrapper.

And this wrapper has Mac-Only arguments like -Xarch_x86_64, which then get converted into the correct args.

象这样的种子可能会击中头部。 Aaargh! 当然,必须找到某种途径来解决这一问题?

问题回答

在QtSDK/Desktop/Qt/4.8.1/gcc/mkspecs,我把Macx-g++的双倍推到macx-g++47。 然后,我从中删除了“include(./common/g++macx.conf)”,并将其列入内容,但产生错误的部分除外(即:X....)。

我也要结束发言。

QMAKE_CC         = gcc-mp-4.7
QMAKE_CXX        = g++-mp-4.7

QMAKE_LINK       = $$QMAKE_CXX
QMAKE_LINK_SHLIB = $$QMAKE_CXX
QMAKE_LINK_C       = $$QMAKE_CC
QMAKE_LINK_C_SHLIB = $$QMAKE_CC

......与Macx-g++42的光谱相类似。

现在,如果我补充的话,它就在面包店工作。

作出大量努力,以简单易行......爱护更好的方式。

有了几个来源,可以向OSX提供更新的电梯。 这里是小选择:

http://hpc.sourceforge.net/ (目前为4.8,以前版本也可能提供)

http://gcc.gnu.org/wiki/GFortranBinaries (单位:4.7.0本安安装器)

I assume that you did install the command line tools from within Xcode. Apple/Xcode is not always up to date with gcc, stability is more important here than bleeding edge.





相关问题
gcc -fPIC seems to muck with optimization flags

Following along from this question: how-do-i-check-if-gcc-is-performing-tail-recursion-optimization, I noticed that using gcc with -fPIC seems to destroy this optimization. I am creating a shared ...

Generate assembler code from C file in linux

I would like to know how to generate assembler code from a C program using Unix. I tried the gcc: gcc -c file.c I also used firstly cpp and then try as but I m getting errors. I m trying to build an ...

Getting rid of pre-compiled headers

OK, I have old Metrowerks code for Mac and Windows where the previous developer used pre-compiled headers for every project that this code base builds. How does one get rid of Pre-compiled headers, ...

Include a .txt file in a .h in C++?

I have a number of places where I need to re-use some template code. Many classes need these items In a .h could I do something like: #include <xxx.txt> and place all of this code in the ....

How to compile for Mac OS X 10.5

I d like to compile my application for version 10.5 and forward. Ever since I upgraded to Snow Leopard and installed the latest XCode, gcc defaults to 10.6. I ve tried -isysroot /Developer/SDKs/...

热门标签