[fpc-pascal] hello world
Mark Morgan Lloyd
markMLl.fpc-pascal at telemetry.co.uk
Thu May 5 12:07:42 CEST 2016
M Pulis wrote:
> Folks:
>
> Apologies for the beginner nature of this query...
>
> why won't this compile? It is the only open file and is saved, looks
> like a main program to me.
>
> program Hello;
>
> begin
> writeln ('Hello, world.');
> readln
> end.
>
>
> getting:
>
> No main program found in open files. Can not build.
What OS are you running, what compiler version, and what's the name of
your file?
$ vi hello.pas
$ fpc hello.pas
Free Pascal Compiler version 3.0.0 [2016/05/04] for arm
Copyright (c) 1993-2015 by Florian Klaempfl and others
Target OS: Linux for ARMHF
Compiling hello.pas
Assembling hello
Linking hello
/usr/bin/ld: warning: link.res contains output sections; did you forget -T?
7 lines compiled, 0.7 sec
$ ./hello
Hello, world.
$
Above done on a Raspberry Pi running Debian. If you're not used to this
environment, $ is the shell prompt.
Notes: Example program was pasted from your mail. Ignore the message
about -T. I hit return after output to satisfy the ReadLn.
--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk
[Opinions above are the author's, not those of his employers or colleagues]
More information about the fpc-pascal
mailing list