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
How to Resume Input Stream After Stopped by Eof in C++
Cin >> Fails with Bigger Numbers But Works with Smaller Ones
How to Get Position of a Certain Element in Strings Vector, to Use It as an Index in Ints Vector
Why Emplace_Back Is Faster Than Push_Back
How to Order the Members of a C++ Class
How to Run a Bash Script from C++ Program
Constexpr Class Taking Const References Not Compiling
C++ Opengl Rotations and Calculations
Why Use an Initialization Method Instead of a Constructor
Undefined Behavior in C/C++: I++ + ++I VS ++I + I++
How to Overload the Conditional Operator
What's the Difference Between Sockaddr, Sockaddr_In, and Sockaddr_In6