And now for some programming...

Scott Lanning slanning at buphy.bu.edu
Sun Jan 2 06:58:45 EST 2000


Kevin M. Gleason wrote:
>I've created my program using my old trusty emacs editor and its
>looking pretty sleek.

May I compliment you on your choice of editor? :)

>How do I run my 'Hello World' C or C++ program using RH Linux?
>I can't seem to locate the words 'how to compile and run' anywhere
>in the documentation.

The compiler is called 'gcc', the "GNU C compiler". 'man gcc'
for details. For a hello world program, you can simply do

    bash$ gcc hello.c -o hello

assuming your source file is called 'hello.c' and you want the
executable file to be called 'hello' (actually, you can even omit
the " -o hello" if you want your output called 'a.out').
    When you get on to more complicated programs involving
multiple source files, you'll want to use 'make' (probably
it's actually 'gmake'). I think it's easiest to learn 'make'
by copying other people's Makefile's (be careful, you MUST use
tabs before the commands......)

-
Subcription/unsubscription/info requests: send e-mail with
"subscribe", "unsubscribe", or "info" on the first line of the
message body to discuss-request at blu.org (Subject line is ignored).



More information about the Discuss mailing list