My guess is the "uses crt" is not needed for linux. If you still need your code to run under turbo pascal then put an IFDEF around it. You also shouldn't need the --automake when compiling...

On Sat, Jan 24, 2009 at 11:05 AM, Alexey Kotlyarov <> wrote:
Being compiled version of GPC installed on Ubuntu, the following very
simple program fails to produce any output:

program testcrt;
uses crt;
       writeln(sqrt(-1)); { error }

$ gpc --automake testcrt.pas -o testcrt
$ ./testcrt
./testcrt: argument to `SqRt' is < 0 (error #708 at 40b6c6)

Notice the absence of OK. Similarly, removing error line makes program
produce no output. Removing 'uses crt;' restores normal behavior.

Version info and such:
$ gpc --version
gpc 20070904, based on gcc-4.1.3 20080420 (prerelease) (Ubuntu
Copyright (C) 2006 Free Software Foundation, Inc.
$ uname -a
Linux flower2 2.6.27-11-generic #1 SMP Fri Jan 23 13:58:13 UTC 2009
x86_64 GNU/Linux

Any ideas of how to fix this?