Try to use FreePascal 1.9.6. Maybe this helps.

You can also try to set the mode to Delphi (compile with -Sd).