Installing GCC on your HOME PC


Obtaining GCC

The GCC compiler can be copied from PC Caledonia by selecting the GCC Compiler Icon in the Computing and Electrical Folder. You will require 5 floppy disks.


Installing

From DOS, or a Windows DOS session, change so you are on C: and insert disk number 1 and type

a:\install

Follow the on screen instructions.

This will install the compiler on drive C:.

After the files have been installed type

gognu

and this will prepare the compiler ready for use. Note: this alters your autoexec.bat file to tell the computer where to find the compiler etc.


Using the Compiler

USing an editor, for example edit which can be invoked by typing edit at the dos prompt, type in your program and save it, for example as hello.c

To compile the program exit from the editor back to the DOS prompt and type

gcc -o hello hello.c

to compile the program in hello.c to give the executable hello. The program can then be run by typing hello at the prompt.


Problems

If when you try to compile the program it tells you messages like "can't find gcc no such file or directory" then it hasn't set up your autoexec.bat file correctly. The manual instructions which do the equivalent of the gognu command mentioned above are given here



Home