[fpc-pascal] linking to dll still fails
Michael Van Canneyt
michael at freepascal.org
Sat Jun 7 10:24:19 CEST 2008
On Sat, 7 Jun 2008, Marc Santhoff wrote:
> Hi,
>
> I still have no success in linking against a dll on windows.
>
> The dll import source looks like this:
>
> ...
> {$linklib 'hdf5'}
You should change this to {$linklib hdf5.dll} for windows. Otherwise the compiler
will try to link to a static library.
> ...
> function H5open:herr_t;{$ifdef BSD}cdecl{$endif}{$ifdef Win32}stdcall{$endif};external;
> function H5close:herr_t;{$ifdef BSD}cdecl{$endif}{$ifdef Win32}stdcall{$endif};external;
It would be better to have
function H5close:herr_t;{$ifndef windows}cdecl{$else}stdcall{$endif};external;
This way it will also work on Linux, and Mac OS X.
Michael.
More information about the fpc-pascal
mailing list