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

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.

Unless you are using DOS and version 1 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 version 1 of the DOS extender, additional processing is required. See section 3.6 on how to create an executable in this case.

You will notice that there is also another 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 shouldn't remove it.



Michael Van Canneyt
Thu Sep 10 13:56:17 CEST 1998