I downloaded the codebot package from
https://github.com/sysrpl/Cross.Codebot.
loaded it and hit compile and got the following compilation error:
codebot.interop.windows.gdiplus.pas(11906,45) Error: Can't determine which overloaded function to call.
The suspect code line, located in the unit gdiplus.pas at line 11,906 (as the error message states) is this:
B := TGdiBitmap.Create(Size * 2, Size * 2); //size is declared as an integer
I thought the constructor is overloaded and two or more signatures are confusing the compiler. But when I checked these signatures, nothing seemed amiss. What am I missing?
Here are these signatures. I've numbered them for ease of discussion
{01} constructor Create(Bitmap: GpBitmap); overload;
{02} constructor Create(Filename: WideString; UseEmbeddedColorManagement: Boolean = False); overload;
{03} constructor Create(Stream: IStream; UseEmbeddedColorManagement: Boolean = False); overload;
{04} constructor Create(Width, Height, Stride: Integer; Format: TPixelFormat; scan0: PByte); overload;
{05} constructor Create(Width, Height: Integer; Format: TPixelFormat = PixelFormat32bppArgb); overload;
{06} constructor Create(Width, Height: Integer; Target: IGdiGraphics); overload;
{07} constructor Create(surface: IDirectDrawSurface7); overload;
{08} constructor Create(var BitmapInfo: TBitmapInfo; BitmapData: Pointer); overload;
{09} constructor Create(Bmp: HBitmap; Pal: HPALETTE); overload;
{10} constructor Create(Icon: HICON); overload;
{11} constructor Create(hInstance: HMODULE; BitmapName: WideString); overload;
//The next set of constructors is taken from the superclass TGdiImge:
{12} constructor Create; overload;
{13} constructor Create(Image: GpImage; Status: TStatus); overload;
{14} constructor Create(Filename: WideString; UseEmbeddedColorManagement: Boolean = False); overload;
{15} constructor Create(Stream: IStream; UseEmbeddedColorManagement: Boolean = False); overload;
//Finally, TGDIobject has one constructor.
{16} constructor Create;
//TGDIObject derives from TInterfacedObject which has no constructors, and TInterfacedObject derives from TObject
Since
size is an integer, the signature at 11,906 is
(integer, integer), which matches the signature of constructor number 5 in the list above, but I'm not able to tell which other signature is clashing with this one. I've already logged an issue on the github of the library, but this is bugging me.
Environment: Lazarus v2.0.12r64642 on windows.