2.5 Testing the compiler

After the installation is completed and the optional environment variables are set as described above, your rst program can be compiled.

Included in the Free Pascal distribution are some demonstration programs, showing what the compiler can do. You can test if the compiler functions correctly by trying to compile these programs.

The compiler is called

To compile a program (e.g demo\hello.pp) simply type :

  fpc hello

at the command prompt. If you don't have a conguration le, then you may need to tell the compiler where it can nd the units, for instance as follows:

fpc -Fuc:\pp\units\go32v2\rtl hello

under dos, and under linux you could type

fpc -Fu/usr/lib/fpc/NNN/units/linux/rtl hello

(replace NNN with the version number of Free Pascal that you are using). This is, of course, assuming that you installed under C:\PP or /usr/lib/fpc/NNN, respectively.

If you got no error messages, the compiler has generated an executable called hello.exe under dos, os/2 or Windows, or hello (no extension) under unix and most other operating systems.

To execute the program, simply type :

  hello

If all went well, you should see the following friendly greeting:

Hello world