Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

And now for some programming...



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).




BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org