How do I compile a Free Pascal program consisting of multiple source files? Specifically, is there a Makefile-like system for Free Pascal?
1
-
You don't need it. Pass search directories and the main file to pascal, and the compiler will do the rest. Pascal has a fully developed Module system. – Marco van de Voort Oct 17 '17 at 18:46
Add a comment
|
The usual way is by using a uses
clause in the preamble of your program to import units from another file. See the Free Pascal Language Reference for a description of the langauge supported by Free Pascal.
-
How do I make a unit? Do I have to compile all the units in my program every time I build a program, and if so, what is the easiest way to include them in other units or the main file? – Techgineer Oct 17 '17 at 17:03
-
2"How do I make a unit?" Start by reading item 16.2 et seq of the FPLR. If you don't have an FPC IDE like Lazarus, you can use your favourite text-file editor. – MartynA Oct 17 '17 at 17:31