Testing the compiler

[prev] [prev-tail] [tail] [up]

### 2.5 Testing the compiler

After the installation is completed and the optional environment variables are set as described above, your first 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

- fpc.exe under Windows, os/2 and dos.
- fpc under most other operating systems.

To compile a program (e.g demo\text\hello.pp), copy the program to your current working directory, and simply type :

fpc hello

at the command prompt. If you don’t have a configuration file, then you may need to tell the compiler where it can find the units, for instance as follows:

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

under dos, and under linux you could type

fpc -Fu/usr/lib/fpc/NNN/units/i386-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

or

./hello

on Unices (where the current directory usually is not in the PATH).

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

Hello world

[prev] [prev-tail] [front] [up]