You can see how poor the Linux part of this proc below looks.
No matter how hard I search (it's several years now! :evil, I am unable to find a *simple* solution to replace the WinAPI's MessageBox function.

The problem is complicated by the fact that my program is written in pure FreePascal, no Lazarus involved.

[pascal] procedure DisplayDyingYells;
var
tit, DyingYell: WideString;
titA: AnsiString;
begin
DyingYell:=ExtractDyingYell();
AddLog(MI_ERROR_MESSAGE_IS, [DyingYell]);
{$ifdef win32}
tit:=MessageContainer[MI_CGE_TITLE] + #0;
titA:=WideToAnsi(tit);
MessageBeep($FFFFFFFF);
if RunningInWindows9x()
//Windows 9x may not have Unicode support installed,
// so we convert the text ourselves and call the ANSI function,
// while assuming that the locale is Russian (cp1251).
then MessageBoxA(0, PChar(WideToAnsi(DyingYell)), @(titA[1]), MB_ICONERROR + MB_OK)
else begin
DyingYell:=DyingYell + #0;
MessageBoxW(0, @(DyingYell[1]), @(tit[1]), MB_ICONERROR + MB_OK);
end;
{$else}
WriteLn(#10#13#10#13#10#13 + ExtractFileName(ParamStr(0) + ' crashed!'));
Writeln(#10#13 + WideToAnsi(DyingYell) + #10#13);
{$endif}
end;[/pascal]

As you can see, to see wghat went wrong the Linux user should run my program from a console and see its output.