Compiler usage
Here we describe the essentials to compile a program and a unit. For more advanced uses of the compiler, see the section on configuring the compiler, and the Programmer’s Guide.
The examples in this section suppose that you have an fpc.cfg which is set up correctly, and which contains at least the path setting for the RTL units. In principle this file is generated by the installation program. You may have to check that it is in the correct place. (see section Compiler configuration for more information on this.)
- File searchingBefore you start compiling a program or a series of units, it is important to know where the compiler looks for its source files and other files. In this sectio
- Compiling a programCompiling 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: fpc [options]
- Compiling a unitCompiling a unit is not essentially different from compiling a program. The difference is mainly that the linker isn’t called in this case. To compile a unit
- Units, libraries and smartlinkingThe Free Pascalcompiler supports smartlinking and the creation of libraries. However, the default behavior is to compile each unit into one big object file, whi
- Reducing the size of your programWhen you created your program, it is possible to reduce the size of the resulting executable. This is possible, because the compiler leaves a lot of information
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
