compilerproc Problem by using it lazarus / 21-General ---------------------------------------------------------------------- paule32 · 2025-05-24 14:30 I have an compilerproc Procedure that the FPC Compiler spite me on the output, and I have implemented it by declaring the signature of the procedure is in interface + implemntation part: 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_assign(var dest: AnsiString; const source: AnsiString); compilerproc;var  pSrc, pDest: PLongInt;begin  // Wenn Ziel gleich Quellstring ist: nichts tun  if Pointer(dest) = Pointer(source) then  Exit;   // Referenz von Zielstring ggf. freigeben  if Pointer(dest) <> nil then  begin    pDest := PLongInt(PAnsiChar(dest) - 8); // Refcount-Adresse    Dec(pDest^);    if pDest^ = 0 then      FreeMem(pDest); // Speicher ganz freigeben  end;   // Quelle kopieren (Pointer übernehmen)  Pointer(dest) := Pointer(source);   // Referenzzähler erhöhen (falls nicht nil)  if Pointer(dest) <> nil then  begin    pSrc := PLongInt(PAnsiChar(dest) - 8);    Inc(pSrc^);  end;end; the compilerproc is also defined, but I get: 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 T:\a>fpc -dDLLEXPORT -dLANGDEU -dDLLDEBUG -n -B -FE. -O3 -Os -gw2 -CD RTLLib.pasSysUtils.pas(112,25) Fatal: Unknown compilerproc "fpc_ansistr_assign". Check if you use the correct run time library.Fatal: Compilation abortedError: C:\fpcupdeluxe\fpc\bin\x86_64-win64\ppcx64.exe returned an error exitcode  The Line: 12 is as follows: S := ''; by this Source: 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 SetLength(var S: AnsiString; NewLen: LongInt); stdcall; export;var  NewPtr: PAnsiChar;  TotalSize: LongInt;begin  if NewLen <= 0 then  begin    S := '';    // <--- there    Exit;  end;   // 12 Bytes für RefCount, Length, Capacity  TotalSize := 12 + NewLen + 1; // +1 für null-Terminator   GetMem(NewPtr, TotalSize);   // Initialisiere Header  PLongInt(NewPtr)^ := 1;                        // RefCount  PLongInt(NewPtr + 4)^ := NewLen;              // Length  PLongInt(NewPtr + 8)^ := NewLen;              // Capacity   // Null- Terminierung (nicht zwingend nötig für AnsiString, aber sicherer)  (NewPtr + 12 + NewLen)^ := #0;   // Setze Stringpointer (S zeigt auf Daten, nicht auf Header!)  Pointer(S) := NewPtr + 12;end; ---------------------------------------------------------------------- marcov · 2025-05-24 17:14 Compileprocs probably need to be in the system unit. ---------------------------------------------------------------------- paule32 · 2025-05-24 17:53 The following code is in system.pas - and it is implemented in interface part of pascal source code (signature)... 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_decr_ref(var s: AnsiString); [public, alias: 'FPC_ANSISTR_DECR_REF']; compilerproc;var  rec: PAnsiRec;begin  if s = nil then    Exit;   // Der Header steht 12 Byte vor den String-Daten  rec := PAnsiRec(s - SizeOf(TAnsiRec));   // Referenzzähler verringern  Dec(rec^.ref);   // Wenn keine Referenzen mehr, Speicher freigeben  if rec^.ref <= 0 then  begin    // Speicher freigeben    FreeMem(rec);  end;end; but the Function is not found by the compiler ---------------------------------------------------------------------- paule32 · 2025-05-25 08:09 Thanks @marcov I have back port the source. now, it works as before. good thing on versioning software like git is: you can get back prior versions of source code. I don't know how long backup's are stored on the Microsoft Servers. But I thinking in mind, that is a Range of 90 days.