Installing GCC on your HOME PC


From DOS, or a Windows DOS session, chnage 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, forexample 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 hrllo 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