* * *

Author Topic: can't determine which overloaded function to call in 64bits windows  (Read 3463 times)

azizi_lazard1988

  • New member
  • *
  • Posts: 24
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

m.abudrais

  • New member
  • *
  • Posts: 23
Re: can't determine which overloaded function to call in 64bits windows
« Reply #1 on: January 07, 2017, 05:50:01 pm »
please show the code which caused  the problem 

Handoko

  • Hero Member
  • *****
  • Posts: 2384
  • My goal: build my own game engine using Lazarus
Re: can't determine which overloaded function to call in 64bits windows
« Reply #2 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

Relativity

  • Jr. Member
  • **
  • Posts: 95
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.

"How'm I gonna get through?"
  -- Pet Shop Boys

Blaazen

  • Hero Member
  • *****
  • Posts: 2570
  • POKE 54296,15
    • Eye-Candy Controls
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.
« Last Edit: June 01, 2018, 05:08:43 pm by Blaazen »
Lazarus 1.9.0 r58554 FPC 3.1.1 x86_64-linux-qt Chakra, Qt 4.8.7/5.11.1, Plasma 5.13.2
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.11

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

Relativity

  • Jr. Member
  • **
  • Posts: 95
Excellent hint: It perfectly works now !
Problem solved.

Thank you very much.
"How'm I gonna get through?"
  -- Pet Shop Boys

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus