FPC 3.2.2 - compilerproc problem with fpc_ansistr_unique lazarus / 21-General ---------------------------------------------------------------------- paule32 · 2025-05-18 14:42 Hello, I am faced with a problem that I can not solve: when I use this source code (without SetLength), I get the message: Code: Bash  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i StrUtils.pas(130,8) Fatal: Unknown compilerproc "fpc_ansistr_unique". Check if you use the correct run time library.Fatal: Compilation aborted Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure fpc_ansistr_unique(var s: AnsiString); compilerproc;var  pSrc, pDst: PChar;  len: LongInt;  refCountPtr: PLongInt;  newMem: Pointer;begin  if Pointer(s) = nil then    Exit;   // RefCount-Adresse berechnen  refCountPtr := PLongInt(Pointer(s) - 8);  len := PLongInt(Pointer(s) - 4)^;   // Nur bei mehrfacher Referenz kopieren  if refCountPtr^ > 1 then  begin    // Neuen Speicherblock mit Header (8 Byte) + Inhalt + Nullterminierung    GetMem(newMem, 8 + len + 1);        // RefCount = 1    PLongInt(newMem)^ := 1;    // Länge übernehmen    PLongInt(Pointer(newMem) + 4)^ := len;    // Daten kopieren    pSrc := PChar(s);    pDst := PChar(Pointer(newMem) + 8);    Move(pSrc^, pDst^, len);    pDst[len] := #0;     // Alten RefCount dekrementieren    Dec(refCountPtr^);     // neuen Zeiger setzen    Pointer(s) := PChar(Pointer(newMem) + 8);  end;end; procedure fpc_ansistr_setlength(var s: AnsiString; newlen: SizeInt); compilerproc;var  tmp: AnsiString;  i: Integer;begin  tmp := StrPas('');  if Length(s) < newlen then  begin    for i := 1 to newlen do    tmp[i] := s[i];  // <-- in this line, the compiler need fpc_ansistr_unique  end else  begin    for i := Length(s) to newlen do    tmp[i] := s[i];  end;  s := tmp;end; ---------------------------------------------------------------------- marcov · 2025-05-18 15:44 Do you also declare it in the interface of the system unit? ---------------------------------------------------------------------- Thaddy · 2025-05-18 15:48 Quote from: paule32 on May 18, 2025, 04:42:05 pmHello, I am faced with a problem that I can not solve: when I use this source code (without SetLength), I get the message: Strutils should not even touch that. (but you are always on the wrong side of the border of what is sensible) It should use UniqueString instead,