[fpc-pascal] -Twin32 linker woes

Tomas Hajny XHajT03 at mbox.vol.cz
Thu Mar 11 16:30:17 CET 2010


On Thu, March 11, 2010 15:28, Adriaan van Os wrote:
> Jonas Maebe wrote:
>> On 11 Mar 2010, at 12:28, Adriaan van Os wrote:
>>
>>> Marco van de Voort wrote:
>>>> In our previous episode, Adriaan van Os said:
>>>>> I am cross compiling with fpc svn trunk and -Twin32 on i386 Mac OS X
>>>>> to Win32. This works fine, except that {$linklib xxx.dll} says
>>>> dlls are usually not $linklib'ed in FPC. What happens if you simply
>>>> omit the
>>>> linklib?
>>>
>>> Well, then the linker complains about unresolved symbols.
>>
>> You have to mention the name of the dll in the procedure declaration:
>>
>> procedure test; stdcall; external 'dllname';
>
> I assume ".dll" is added only if "dllname" doesn't have an extension ? For
> example, Apple's
> QuickTIme SDK for Windows is distributed with .lib files to link with and
> if I look up the
> corresponding ddl in the WIndows system32 directory, it is
> "QuickTime.qts", not "QuickTime.dll".

Those .lib files are probably import libraries (these are necessary for
some compilers which cannot generate the imports themselves on the fly).


> It looks like the dll is not checked at link-time to see if e.g. the
> stdcall-mangled names match
> and the routine is present ?

The idea is that it should be possible to compile and link even without
having all the DLLs installed on the development machine (otherwise
cross-compilation would be rather difficult - I suspect that there may be
no legal way of installing Windows system DLLs to a *nix machine).

Tomas





More information about the fpc-pascal mailing list