chronozphere
08-05-2010, 10:54 PM
Hey guys,
I can't get my code to compile. it says:
[Pascal Error] n3d_shaderprogram.pas(184): E2018 Record, object or class type required
procedure Test(const a: TVector4f);
var
d: Single;
begin
d := a.x; //error here
end;
Defined in another unit:
PVector4f = ^TVector4f;
TVector4f = record
case Boolean of
true: ( x, y, z, w: Single; );
false: ( xyzw: array [0..3] of Single; );
end;
It works for TVector2f and TVector3f. Only TVector4f makes problems. >:( :(
I cant test it in Delphi 2010 because the SDL unit won't compile there (I don't think I can reproduce it by just isolating these routines... I tried that).
I tried compiling with lazarus. But it didn't help. It gave the following error:
G:\n3d\workingdir\src\n3d_shaderprogram.pas(184,9) Error: Illegal qualifier
Any ideas? I'm really stuck here. :(
I can't get my code to compile. it says:
[Pascal Error] n3d_shaderprogram.pas(184): E2018 Record, object or class type required
procedure Test(const a: TVector4f);
var
d: Single;
begin
d := a.x; //error here
end;
Defined in another unit:
PVector4f = ^TVector4f;
TVector4f = record
case Boolean of
true: ( x, y, z, w: Single; );
false: ( xyzw: array [0..3] of Single; );
end;
It works for TVector2f and TVector3f. Only TVector4f makes problems. >:( :(
I cant test it in Delphi 2010 because the SDL unit won't compile there (I don't think I can reproduce it by just isolating these routines... I tried that).
I tried compiling with lazarus. But it didn't help. It gave the following error:
G:\n3d\workingdir\src\n3d_shaderprogram.pas(184,9) Error: Illegal qualifier
Any ideas? I'm really stuck here. :(