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

patspiper patspiper at gmail.com
Sun Jun 21 18:43:10 CEST 2015


On 20/06/15 18:41, Bo Berglund wrote:
> 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? 
Add the following options to the objconv command line:
-nr:GetVersion:_$dll$kernel32$GetVersion
-nr:GetLastError:_$dll$kernel32$GetLastError
-nr:WriteFile:_$dll$kernel32$WriteFile
-nr:ReadFile:_$dll$kernel32$ReadFile
-nr:DeviceIoControl:_$dll$kernel32$DeviceIoControl
-nr:CloseHandle:_$dll$kernel32$CloseHandle
-nr:GetTickCount:_$dll$kernel32$GetTickCount
-nr:GetPrivateProfileIntA:_$dll$kernel32$GetPrivateProfileIntA
-nr:GetPrivateProfileStringA:_$dll$kernel32$GetPrivateProfileStringA
-nr:CreateFileA:_$dll$kernel32$CreateFileA

You might have to add to the project's linker options (-k): -lkernel32

If Lazarus can't locate it, search for libkernel32.a and put it in the 
project folder to test (you can use the linker option -L to specify the 
libkernel32.a folder).

Test and let us know what happens :)

Stephano




More information about the Lazarus mailing list