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



The compilers are gcc (for C language and g++ for C++). The standard 
compile lines are (assuming that cc is linked to gcc).
cc hello.c -o hello
c++ helloplus.c++ -o helloplus

You can use gcc or g++, but the cc and c++(or cxx) commands are pretty 
universal in Unix systems. The -o command line option directs the linker to 
create the executable named hello or helloplus. If this is omitted, the 
linker will create the executable as a.out. On Unix systems, the language 
command (eg. cc) is normally a wrapper which calls the various compile 
steps and the link step. The Linker on most Unix and Linux systems is the 
ld command, but you don't need to use it.

cc prog.c -c  # this creates prog.o
cc prog.o -o prog # This takes the object file and links it. 



"Kevin M. Gleason" wrote:
> I've created my program using my old trusty emacs editor and its looking
> pretty sleek.
> 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.
-- 
Jerry Feldman <gaf at blu.org>
Boston Linux and Unix user group
http://www.blu.org


-
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