How to use the GNU (gcc) Compiler


If you want to use the GNU C (gcc) compiler to compile your code from the command line (at your athena% prompt) just type:
add cygnus (once only in each window per login session)
gcc myprog.c (every time you want to compile)
(If you are using Linux or NetBSD and don't have gcc installed locally, use "add gnu" instead) If you use Makefiles to compile your programs, then put the following line at the top of your Makefile:
CC=gcc
If you have any problems with this compiler, send mail to gnu@mit.edu with a description of your problem. Do not send mail to bugs@mit.edu; this is not officially supported software, although you are likely to get help with your problem from those who maintain the gnu file system at Athena.

For information on gcc, see our stock answer on What C COMPILERS are available. You may also type the following from your athena% prompt:

add cygnus
man gcc
Finally, if you are familiar with the info system in emacs, there is information on gcc available by entering info with the keystrokes:

C-h i
and then typing
g(/mit/gnu/info/dir)Top
Be sure to first type (at the athena% prompt):
attach gnu
last updated: 6/12/95