On 9 Sep 2003, Tony Crouch wrote:
Hi all, I'm a beginner to Pascal and also to the linux operating system, i've done some C++ programming before and am not wanting to discover my roots by relearning some pascal stuff ... just for something different.
My question is in regards to compiling pascal programs, i'm guessing that pascal programs can be made with an ordinary plain-text editor with the extension .pas.
I'm using Linux Red Hat 8 and i'm guessing that there'd be some among you who've had some exposure to C++ (or C) and you'll know that to compile a C++ program in Linux you go to terminal (or within your text editor ... i.e. emacs or xemacs) and type in g++ example.cpp -Wall -o example, where example.cpp is the text file and example is the executable file that results from compiling.
Could someone please inform me as to what the command line is to compile a pascal program on linux red hat 8.
Hi, Tony,
Finally something easy enough for me to reply - so others would save their time, and I could be a contributing member of list society ;-)
% cat > hello.pas program hello(output); begin WriteLn ('Hello, world!') end. ^D % gpc -o hello hello.pas
So, it's rather easy, you just replace g++ with gpc, and apply on corresponding source.
You can use:
% gpc --help
to see a short list of available options, and ``info gpc'' to learn more about gpc options, compiler itself and language.
Mirsad