Compiler Error - Overloaded Function in Source Code?
PostPosted: 05 Aug 2013, 23:24
I recently followed the step by step guide for compiling the source code project, didn't change a thing, but I ran into an error on line 414 in KM_Points that states the following:
\castlesand\KM_Points.pas(414,13) Error: Can't determine which overloaded function to call
\castlesand\KM_Points.pas(389,10) Hint: Found declaration: KMGetDirection(Single,Single):<enumeration type>;
\castlesand\KM_Points.pas(372,10) Hint: Found declaration: KMGetDirection(LongInt,LongInt):<enumeration type>;
\castlesand\KM_Points.pas(713) Fatal: There were 1 errors compiling module, stopping
The function is coded as follows:
function KMGetDirection(FromPos, ToPos: TKMPoint): TKMDirection;
begin
Result := KMGetDirection(ToPos.X - FromPos.X, ToPos.Y - FromPos.Y);
end;
I, for the life of me, cannot figure out where this error is coming from. I understand overloading and everything seems to be great. I'm using Lazarus IDE v1.0.10 and I'm familiar with using Java/C++ but not Pascal so please forgive me if this is a stupid question. Thanks!
\castlesand\KM_Points.pas(414,13) Error: Can't determine which overloaded function to call
\castlesand\KM_Points.pas(389,10) Hint: Found declaration: KMGetDirection(Single,Single):<enumeration type>;
\castlesand\KM_Points.pas(372,10) Hint: Found declaration: KMGetDirection(LongInt,LongInt):<enumeration type>;
\castlesand\KM_Points.pas(713) Fatal: There were 1 errors compiling module, stopping
The function is coded as follows:
function KMGetDirection(FromPos, ToPos: TKMPoint): TKMDirection;
begin
Result := KMGetDirection(ToPos.X - FromPos.X, ToPos.Y - FromPos.Y);
end;
I, for the life of me, cannot figure out where this error is coming from. I understand overloading and everything seems to be great. I'm using Lazarus IDE v1.0.10 and I'm familiar with using Java/C++ but not Pascal so please forgive me if this is a stupid question. Thanks!