Unit files_(re)
Tue, 29 Jul 1997 16:34:29 +0200 (MET DST)
According to Joao Miguel:
>
> Can anyone tell me if GPC 2.0 supports units (like borland's) and how ?
It does, just like Borland Pascal.
> I downloaded the zip file bpcompat-1.0.zip that encloses a lot of very
> useful units. When trying to compile the program test.pas that comes on
> it, the compiler "says": "no exported interface matching gpctypes" and so
> on. One error for each uses clause.
Like with Borland Pascal, you must either first "compile" all Units, and
then the main program,
gpc -c myfirstunit.pas
gpc -c mysecondunit.pas
gpc myprogram.pas myfirstunit.o mysecondunit.o -o myprogram
or else you "make" the program, i.e. you tell the compiler to compile
all Units automatically. With GPC, this is done with the `--automake'
option. The following
gpc --automake myprogram.pas -o myprogram
automatically compiles `myfirstunit' and `mysecondunit' and links them
to the main program.
(* Just for completeness: The `-o myprogram' means: output an executable
`myprogram' (or `myprogram.exe') rather than `a.out' (or `a.exe'). *)
Hope this helps,
Peter
Dipl.-Phys. Peter Gerwinski, Essen, Germany, free physicist and programmer
peter.gerwinski@uni-essen.de - http://home.pages.de/~peter.gerwinski/ [970201]
maintainer GNU Pascal [970714] - http://home.pages.de/~gnu-pascal/ [970125]
Peter Gerwinski (peter@agnes.dida.physik.uni-essen.de)
HTML conversion by Lluís de Yzaguirre i Maura
Institut de Lingüística Aplicada -
Universitat "Pompeu Fabra"
e-mail: de_yza@upf.es