next up previous contents
Next: Compiling a unit Up: Compiler usage Previous: Compiler usage

Compiling a program

Compiling a program is very simple. Assuming that you have a program source in the file prog.pp, you can compile this with the following command:

  ppc386 [options] prog.pp
The square brackets [] indicate that what is between them is optional.

If your program file has the .pp or .pas extension, you can omit this on the command line, e.g. in the previous example you could have typed:

  ppc386 [options] prog

If all went well, the compiler will produce an executable, or, for version 1 of the DOS extender, a file which can be converted to an executable.

Under LINUX and version 2 of the DOS extender, the file you obtained is the executable. You can execute it straight away, you don't need to do anything else. Under DOS, additional processing is required. See the section on creating an executable.

You will notice that there is also anothe file in your directory, with extensions .o. This contains, the object file for your program. If you compiled a program, you can delete the object file (.o), but not if you compiled a unit. Then the object file contains the code of the unit, and will be linked in any program that uses the unit you compiled, so you shpuldn't remove it.



Michael Van Canneyt
Tue Mar 31 16:44:14 CEST 1998