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]
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to