I recently installed Gnu Pascal (DJGPP-MSDOS) and was appalled at the
fragility
of the compiler.
I had enormous problems with procedural-parameters, file types and
proper
accessing of types defined in Units.
Eventually, I downloaded the latest alpha
(gpc-980511.i386-pc-msdos-djgpp.zip)
and am delighted that this version will at least compile my program.
If someone could tell me where to get the crtf.o file, the linker keeps
asking for,
I might even be able to see if the code actually runs.
The compiler still apparently has problems with type definitions in
units.
I have a program that uses two units:
1) pktdefs - type definitions
2) frames - unit to handle access to large data files
The frames unit declares an object that has a method:
function GetNextDataPkt(VAR pkt : PacketPtr) : BOOLEAN;
The type PacketPtr is declared in pktdefs and my main program and frames
USE pktdefs.
When my main program tries to call GetNextDataPkt, I get a compiler
error:
Error: type mismatch in argument 2 of `Tframes_Getnextdatapkt'
The code in question is:
while MyFrames.GetNextDataPkt(pp) do
If I move the PacketPtr declaration into frames.pas, the compiler error
disappears.
I don't know how there can be an error in argument 2 of a function with
only one parameter.
Perhaps the return value is argument 1.
However, the compiler apparently thinks that the type "PacketPtr" used
in frames is different
from "PacketPtr" used in the main program, even though both "import" the
declaration
from the same unit.
Russell Thamm