[fpc-pascal] Porting jcl to fpc on linux : Status and some questions

Marco van de Voort marcov at stack.nl
Sun Apr 23 20:29:52 CEST 2006


> Now for something I really do not understand, but perhaps I am still too 
> inexperienced with fpc to find out what is going wrong here:
> 
> pthread.inc:
> Function InitializeCriticalSection(var lpCriticalSection: 
> TRTLCriticalSection): Integer;
> 
> JclSysUtils.pas:
> ...
> FCriticalSection: TRTLCriticalSection;
> ...
> constructor TJclIntfCriticalSection.Create;
> begin
>   inherited Create;
>   Libc.InitializeCriticalSection(FCriticalSection);
> end;
> 
> Now I get the following compile Error:
> 
> JclSysUtils.pas(2969,50) Error: Call by var parameters have to match 
> exactly: Got "TRTLCriticalSection" expected "pthread_mutex_t"
> 
> How can I find out what is going wrong here?

Probably libc.trtlcrit... and the system own TRTLCritsection.

Keep in mind that libc is only a Kylix compat library in FPC, and not meant for new
development. Ordinary FPC programs (and FPC, Lazarus) do no use it, it is
not portable. 

It would be wiser to base JCL4FPC on the  FPC native unix libs like baseunix
and unix, and not on the linux (/x86) specific unit libc.



More information about the fpc-pascal mailing list