Board index » delphi » Error compiling VCL source code

Error compiling VCL source code

I'm trying to install the VCL source for Delphi 1 from
the Delphi RAD pack.  After adding the VCL directory
to the library search path and recompiling my program, I
get a compile error in VCL\CLASSES.PAS.

The error is in the function:

procedure TStream.WriteComponentRes(const ResName: string; Instance:
TComponent);
var
  HeaderSize: Integer;
  Origin, ImageSize: Longint;
  Header: array[0..79] of Char;
begin
  Byte((@Header[0])^) := $FF;
  Word((@Header[1])^) := 10;
  HeaderSize := StrLen(StrUpper(StrPLCopy(@Header[3], ResName, 63))) +
10;
  Word((@Header[HeaderSize - 6])^) := $1030;
  Longint((@Header[HeaderSize - 4])^) := 0;
  WriteBuffer(Header, HeaderSize);
  Origin := Position;
  WriteComponent(Instance);
  ImageSize := Position - Origin;
  Position := Origin - 4;
  WriteBuffer(ImageSize, SizeOf(Longint));
  Position := Origin + ImageSize;
end;

And occurs in the second line of the function body:
  Word((@Header[1])^) := 10;
The cursor is just before the semi-colon, and the error message is

Error 122 : Invalid variable reference

Any suggestions as to what the error means, and how I can get it to
compile?  I don't understand how the VCL source code could be shipped
but not compile! This makes me think there is something else that I
haven't done, but I don't know what...

Thanks,

Francis Irving
Vega Group PLC.

 

Re:Error compiling VCL source code


Quote
francis.irv...@vegauk.co.uk (Francis Irving) wrote:
>I'm trying to install the VCL source for Delphi 1 from
>the Delphi RAD pack.  After adding the VCL directory
>to the library search path and recompiling my program, I
>get a compile error in VCL\CLASSES.PAS.

>And occurs in the second line of the function body:
>  Word((@Header[1])^) := 10;
>The cursor is just before the semi-colon, and the error message is

>Error 122 : Invalid variable reference

>Any suggestions as to what the error means, and how I can get it to
>compile?  I don't understand how the VCL source code could be shipped
>but not compile! This makes me think there is something else that I
>haven't done, but I don't know what...

The error means that you are compiling with the wrong compiler
settings. You get this error when compiling with pointer type checking
turned on. Ususally this is only a safety check at compile time and
does not do any changes to the compiled code.

Just a warning: You will not be able to recompile the WHOLE VCL anyway
as a couple of sources (TabbedNotebook for instance) is missing.

I personally would be very interested in DBDsgn (or so) to fix a bug
in the implementation part of DB.PAS - but not luck...

Other Threads