Hi all,
I'm trying to use the simple GPC modules mechanism, as described in the Doc (7.1.8.1, page 85), and can't figure out how to link the provided example, with module DemoMod3 and program ModDemo3.
I'm using GPC 20011202 on Solaris-8; I tried several methods, for example:
% gpc --automake moddemo3.pas
and always get undefined linking errors:
Setfoo /var/tmp/cc2daawp1.o Getfoo /var/tmp/cc2daawp1.o
I guess the solution is really simple, but can't find it, please help!
Here's the example source code:
module DemoMod3;
type FooType = Integer;
var Foo : FooType;
procedure SetFoo (f : FooType); begin Foo := f; end; { SetFoo }
function GetFoo: Footype; begin GetFoo := Foo; end; { GetFoo }
end.
program ModDemo3 (Output);
type FooType = Integer;
procedure SetFoo (f : FooType); external; function GetFoo: FooType; external;
begin SetFoo (999); Writeln (GetFoo); end.
-- Nicolas