The content of this document may be incorrect or outdated.
Print this article Edit this article
C compilers that are available
The compiler takes a source file (which contain human-readable instructions) and translates it into an object file (which contains machine-readable instructions).
The program file created by the text editor is called the source or source code. The names of C source files must end with the extension .c. The source code is machine independent. You can take your source code from one machine to another without changes, almost. You may encounter portability problems..
Object files are machine dependent. They are custom-made for each machine and are non-portable. On UNIX, object filenames end with the extension .o.
The compiler's job is to translate C code (high-level code) into instructions that can be executed by the CPU (low-level code).
C Compilers
- Sun supplied compiler V.
2.0.1 ANSI C is located in
/usr/opt/bin/cc
. Since/usr/opt/bin
should already be in your path, just typing cc file.c will give you this compiler. - GNU C compiler is located in
/usr/local/bin/gcc
. Since/usr/local/bin
should already be in your path, just typing gcc file.c will give you this compiler. - K& R compiler is located
in
/usr/ucb/cc
. This is a front end to real ANSI compiler. This may not be available in the next release of the operating system. ECN suggests using the default Sun compiler located in/usr/opt/bin/cc
.
C++ Compilers
- Sun supplied C++ compiler is
located in
/usr/opt/bin/CC
. Since/usr/opt/bin
should already be in your path, just typing CC file.c will give you this compiler. - GNU C++ compiler is located
in
/usr/local/bin/g++
. Since/usr/local/bin/
should already be in your path, just tying g++ file.c will give you this compiler.
Last Modified:
Dec 19, 2016 11:12 am US/Eastern
Created:
May 29, 2007 1:10 pm GMT-4
by
admin
JumpURL: