Lazarus

Installation => Windows (32/64) => Topic started by: azizi_lazard1988 on December 12, 2016, 04:31:33 pm

Title: can't determine which overloaded function to call in 64bits windows
Post by: azizi_lazard1988 on December 12, 2016, 04:31:33 pm
hello friends , i have application developed by lazarus  and i have ambigus problem
when i compile the program in windows 7 64 bits i got error

Quote
can't determine which overloaded function to call 

but when i compile the application in windows 7 32 bits the application work fine
i can't fixe this problem so please help me
thank you
Title: Re: can't determine which overloaded function to call in 64bits windows
Post by: m.abudrais on January 07, 2017, 05:50:01 pm
please show the code which caused  the problem 
Title: Re: can't determine which overloaded function to call in 64bits windows
Post by: Handoko on January 07, 2017, 06:18:21 pm
Hello azizi_lazard1988.

What is the bit version of the Lazarus you're currently using? I mean is it 32-bit or 64-bit? To find it, on Lazarus main menu > click Help > About Lazarus.

If you're currently using 32-bit version, then you may need to prepare your FPC to cross compile Win64. You can find more info on this wiki page, especially on the topic "From win32 to win64":
http://wiki.lazarus.freepascal.org/Cross_compiling
Title: Re: can't determine which overloaded function to call in 64bits windows
Post by: Relativity on June 01, 2018, 04:44:16 pm
I have the following code:

Code: Pascal  [Select]
  1. uses
  2.   Classes, SysUtils, f, numericalutilities, math;
  3. [...]
  4. type
  5.   TSCAM = class(TObject)
  6.     protected            
  7.       firstAs, firstThetas : Array[0..1000] of Array [1..100] of Real;  
  8. [...]
  9. Procedure TSCAM.CalculateFirstMeanAndVariance();
  10. var
  11.   parameterCounter : Integer;
  12. begin
  13.   for parameterCounter := 0 to ParametersHighestIndex do
  14.     begin
  15.       AVariance[parameterCounter] := Variance(@firstAs[parameterCounter][1],100);
  16. //      ThetaVariance[parameterCounter] := Variance(@firstThetas[parameterCounter][1],BurntInNumber);
  17.     end;
  18. end;          
  19.  

and I get the message from the compiler "Error: Can't determine which overloaded function to call" referring to the function Variance, from the math unit.
But I do everything on the same only computer I installed Lazarus 1.8.2 on. Why These Problems ?

In "About Lazarus" it reads :

Version :1.8.2
[...]
x86_64-win64-win32/win64

I have Windows 7.

Title: Re: can't determine which overloaded function to call in 64bits windows
Post by: Blaazen on June 01, 2018, 05:02:38 pm
Use Double instead of real:
Code: Pascal  [Select]
  1.  firstAs, firstThetas : Array[0..1000] of Array [1..100] of Double;  
  2.  [...]
  3.  AVariance[parameterCounter] := Variance(PDouble(@firstAs[parameterCounter][1]),100);

EDIT: This happens on x86_64 platform where Extended = Double but PDouble and PExtended are new types and compiler can distinguish them.
Title: Re: can't determine which overloaded function to call in 64bits windows
Post by: Relativity on June 01, 2018, 05:15:57 pm
Excellent hint: It perfectly works now !
Problem solved.

Thank you very much.