How to Use the Gcc Installed in MACports

How to use the gcc installed in macports?

I remember it being something like g++-mp-4.6. I believe it's enough to set the environment variable CXX to that.

MacPorts GCC compiler, -Wa,-q and (/opt/local/bin/clang) not installed

You can simply do sudo port select clang mp-clang-3.8. I did not like this, because it makes this the default when simply calling clang (only if MacPorts is on the PATH, of course).

What I ended up doing is to replace /opt/local/bin/as with the following simple script:

#!/bin/sh 
clang -c -x assembler $@ -

And then I don't use the -Wa,-q arguments to gcc.

after the installation via MacPorts of gcc45, how can I use it to build C language on my Mac?

You command-line output indicates rather clearly that you aren't telling gcc what to compile, so it's throwing its hands up in exasperation:

$ gcc
i686-apple-darwin10-gcc-4.2.1: no input files

You'll need to specify the file you're compiling. Better yet, use an IDE, like Xcode.



Related Topics



Leave a reply



Submit