<p>Am 14.07.2016 07:08 schrieb "Bo Berglund" <<a href="mailto:bo.berglund@gmail.com">bo.berglund@gmail.com</a>>:<br>
><br>
> I am porting a Delphi2007 utility from Windows to Linux (Raspbian<br>
> Jessie). It uses a unit I have downloaded from the web, which was said<br>
> to support FreePascal too.<br>
><br>
> But now I am getting a number of missing identifier errors as follows<br>
> Function calls:<br>
> - SetFilePointer<br>
> - GetFileTime<br>
> - FileTimeToLocalFileTime<br>
> - FileTimeToDosDateTime<br>
> - SetEndOfFile<br>
><br>
> Constants:<br>
> - FILE_CURRENT<br>
> - INVALID_HANDLE_VALUE<br>
><br>
> It seems like these are defined in Windows and now in FPC they are<br>
> elsewhere.</p>
<p>Those functions and constants don't exist on non-Windows. Try to convert your code to one of the abstractions Free Pascal (and also Delphi) provides, e.g. FileOpen() and friends or TFileStream.</p>
<p>> The uses clause of the unit has the following content:<br>
><br>
> uses<br>
> {$ifdef MSWINDOWS}<br>
> Windows,<br>
> {$else}<br>
> LibC, <== Error here, not found<br>
> Types,<br>
> {$endif}<br>
> SysUtils;<br>
><br>
> It could not find LibC and when I asked on the Lazarus list I got a<br>
> reply to try Unix and/or BaseUnix instead. But this does not work so I<br>
> guess these functions are in another FPC unit somewhere.<br>
><br>
> What should I add to the uses clause in place of LibC to get it to<br>
> compile on Linux?</p>
<p>The LibC unit only exists on i386-linux and only for compatibility for Kylix. Other than that you should consider that unit as deprecated and instead use units like Unix, BaseUnix or Linux, depending on what functionality you need.</p>
<p>Regards,<br>
Sven</p>