01-23-04 10:16 PM
Shane Malden <smalden@bigpond.net.au> wrote:quote:
> Hi, Can someone help me out.. After writting the code in c or c++ what
> commands in RedHat do you use to compile the application?
That's a bit difficult to tell because that might depend on which
libraries you need etc. But in the most simple case, when you have
a single source file that doesn't depend on any external libraries
(except the system library), it can be as easy as
make myprog
if the source file is named myprog.c or myprog.cpp. If you wnat to
invoke the compiler and linker directly instead of having the make
utility do the work for you you may just need
gcc -o myprog myprog.c
or
g++ -o myprog myprog.cpp
If you require math functions you have to add '-lm' to these lines.
Of course, all of the above assumes that you have 'make' and gcc
installed on your system.
quote:
> Once compiled do you just run it as any other command?
Yes. Just type './myprog' and it should be executed (depending on
how your system is set up you may even be able to drop the './' bit
at the start of the command).
Regards, Jens
--
\ Jens Thoms Toerring ___ Jens.Toerring@physik.fu-berlin.de
\__________________________ http://www.physik.fu-berlin.de/~toerring
[ Post a follow-up to this message ]
|