[fpc-pascal] FPC 2.4.1 with library that requires old libc unit.

Graeme Geldenhuys graemeg.lists at gmail.com
Fri Apr 23 09:45:39 CEST 2010


I'm trying to update a set of database components (FBLib) used with tiOPF.
In FPC 2.2.0 (32bit linux) everything compiled and worked fine. Today I
tried to compile my latest version of FBLib (as is found in tiOPF
repository) with FPC 2.4.1 (64bit linux).  I don't know if the following
problems are related to 32bit -> 64bit switch or because of FPC 2.2.0 ->
FPC 2.4.1 switch.

1) First I had the problem that FPC couldn't find 'Libc' unit used in the
uses clause. No idea why - maybe Libc unit is only 32bit?  Anyway, I
replaced 'Libc' in uses clause with 'baseunix' and continued...

2) This got me a bit further, to the code shown below. Is there a baseunix
equivalent to Libc.mblen()? Can anybody help me resolve this compilation issue?

This URL describes what mblen() does:


function TFBLScript.CStrNextChar(const AStr: PChar): PChar;
  CharLen: Integer;
  CharLen := Libc.mblen(AStr, MB_CUR_MAX);     // <<-----
  if (CharLen = -1)
    then CharLen := 1;
  Result := AStr + CharLen;
  Result := CharNext(AStr);

  - Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal

More information about the fpc-pascal mailing list