[Lazarus] Newbie, porting class to FPC but get procedure assignment error

patspiper patspiper at gmail.com
Sat Jun 20 17:56:41 CEST 2015


On 20/06/15 18:41, Bo Berglund wrote:
> On Sat, 20 Jun 2015 13:33:09 +0200, Bo Berglund
> <bo.berglund at gmail.com> wrote:
>
>> On Sat, 20 Jun 2015 13:49:00 +0300, patspiper <patspiper at gmail.com>
>> wrote:
>>
>>>> Seems like I am almost there except this list of errors....
>>> These are used in SPROMEPS.OBJ.
>>>
>> I figured as much, problem is why that works in Delphi but not in
>> FPC/Lazarus? The special functions would of course need the
>> definitions etc, but the WinAPI calls should "just execute", or not?
>>
> After thinking a while more I don't really understand the problem...
> Why are there errors thrown for function calls originating inside the
> obj file functions?
>
> If the functions inside the obj function are calling Windows API
> functions, why should that be a problem such that Lazarus throws an
> error?
> It seems like the executable code inside the obj should be able to
> handle this itself, right?
Maybe someone more knowledgeable with linkers can help better, but I 
think that the linker cannot know that these functions are in kernel32.dll.

Do you have kernel32.lib (import library) and kernel32.dll? It should be 
included with the Windows sdk.

http://www.mingw.org/wiki/createimportlibraries shows a way of creating 
an import library from a dll.

Once you have the import library, try adding -lkernel32.lib to the 
linker options in the project options and let's see the result.

Stephano




More information about the Lazarus mailing list