Hi,
I need port component in Delphi2006 to C++Builder2006. In this case,
the Freeimage library (open source) need to be integrated via a run-time package for use
I try to rebuild the package in C++Builder (transforming the lib with the utility Coff2Omf).
But the linker shows many times the same error type :
[Linker Error] Error: Unresolved external '_FreeImage_GetFileType@8' referenced from
C:\xxx\DEBUG_BUILD\FREEUTILS.OBJ
.....
[Linker Error] Error: Unresolved external '_FreeImage_ConvertTo16Bits555@4' referenced from
C:\xxx\DEBUG_BUILD\FREEBITMAP.OBJ
.....
The package project "contains" the FreeImage.lib. The FREEUTILS.pas and the FREEBITMAP.pas
files reference a third file (there is only three files in the package) FreeImage.pas
(I have renamed it to FreeImageUnit.pas to avoid conflict with the Freeimage.lib when adding
it to the package project). In this last unit FreeImage(Unit).pas, all the definitions are done:
const
FIDLL = 'FreeImage.dll';
.....
function FreeImage_GetFileType(const filename: PChar; size: Integer): FREE_IMAGE_FORMAT;
stdcall; external FIDLL name '_FreeImage_GetFileType@8';
function FreeImage_GetFileTypeU(const filename: PWideChar; size: Integer): FREE_IMAGE_FORMAT;
stdcall; external FIDLL name '_FreeImage_GetFileTypeU@8';
....
Each function in the two others units (FreeUtils and FreeBitmap) do calls in the FreeUtils(Unit).pas
that itself map each function in the dll using External keyword.
There is certainly a thing that I forget but which ? It appears that the linker cannot do the join
between the lib/dll and declaration in the pas units. Redeclaring the external in the FreeUtils
doesn't change anything. (In D2006, it works perfectly)
Some idea is wellcom...
Thanks
Eddy Poullet
Brussels