Does Linux Red Hat 7.2 have a built in C compiler? If so, how do I access it?
Thanks,
Bud
Does Linux Red Hat 7.2 have a built in C compiler? If so, how do I access it?
Thanks,
Bud
Try whereis gcc. If it returns /usr/bin/gcc, it's installed. Otherwise search your Red Hat cdroms; mkdir /cdrom; mount -t cd9660 /dev/cdrom /cdrom && find /cdrom -name "*gcc*"
Code:cat > foo.c #include <stdio.h> int main() { puts( "hello world!" ); return 0; }^D gcc foo.c -o foo && ./foo
you should do if you installed it on setup.
to test you do type
which gcc
this will tell you if you have it, if you do it'll tell where it is installed.
To use it you have to be in konsole, when you are there you can use it from any directory. Simply type
gcc -Wall filename -o program-Name
"-Wall" turns all warnings on
"-o program-Name" program-Name becomes the executable
"filename" can be a list of C files
if you don't use -o option, then it compiles the program to the default "a.out"
to run the program type:
./program
the dot-slash specifies the program is in the current directory
hope this helps
kwigibo
redhat does bundle gcc with it. as a matter of fact, it changed gcc 2.95.3 and renamed it 2.96RH.
howdy,
you might try this.
open a new file in emacs name it hello.cpp
code the "hello world" thing
go to the "tools" menu and select "Compile"
then open a terminal window and (like sugested before) type ./hello.
if this works your on your way.
on my RH 7.2 install the compiler defaults to gcc 2.96 and has all of the libraries pathed in corectly.
M.R.
I don't like you very much. Please post a lot less.
Cheez
*and then*
No, I know you were joking. My point still stands.
that may not always work. on my emacs the compiler is not pre-determined. just run "gcc -v" at the command prompt and it should tell you something about gcc (or the fact that it doesn't exist.)
gcc and g++ come nearly with all dist.(rehat suse mandreke....) use man gcc/g++ to learn how it works
C++ Makes you Feel Better
"Gravity connot be held reponsible for people falling in love"--Albert Einstein