[fpc-pascal] -Twin32 linker woes

Jonas Maebe jonas.maebe at elis.ugent.be
Thu Mar 11 12:50:08 CET 2010


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';

> Does that mean that LoadLibrary and GetProcAddress must be called  
> for all external dll calls ?

No.

> Anyway, the "not found" message is confusing. I suggest a  
> clarification in the section about {$linklib} in the Free Pascal  
> Programmer’s Guide that only static libraries can be linked.

That only applies to Windows.


Jonas


More information about the fpc-pascal mailing list