LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 02-21-2005, 07:42 AM   #1
Jaykay3k
LQ Newbie
 
Registered: Feb 2005
Posts: 23

Rep: Reputation: 15
Question Redhat 9 GCC compiler HELP! (n00b here)


Hi,

i have recently just installed redhat 9 and now trying to install a C compiler so that i can use tcl scripts.

I have download gcc-3.4.2 and extracted, and since I am a n00b the steps required need some clarification, these are the things confusing me:

1) it asks to check for specific system intallation guide, but there is no redhat 9 on the list!

2) what is a bootstrap?

3) to configure it I must do this

%mk objdir
%cd objdir
%srcdir/configure [option] [target]

I have a fair idea in what is happening but would be greatfull if some explained to me what lines are doing, especially the last one! i dont know what they mean by [option] [target].

I am guessing objdir is where my objects for program will be installed to and srcdir is the source from which the program will be installed from?
 
Old 02-21-2005, 08:29 AM   #2
masand
Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 58
hi there

don' u want to use the gcc from ur REDHAT 9.0 CD??

regards
 
Old 02-21-2005, 11:28 AM   #3
Jaykay3k
LQ Newbie
 
Registered: Feb 2005
Posts: 23

Original Poster
Rep: Reputation: 15
i just checked all the RPMs redhat9 on disc 3, There isnn't any GCC in there. what is it called? is it under another name? please specify. thx
 
Old 02-21-2005, 11:48 AM   #4
masand
Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 58
hi there

u will get rpms in the name of gcc-,gcc-c++,like these
there are many of them
maybe in the 1st or 2nd CD,i don't remeber
but there surely those packages .i have used gcc in RH9.0

regards
 
Old 02-23-2005, 10:36 AM   #5
Tuetates
LQ Newbie
 
Registered: Feb 2005
Location: uk
Distribution: debian sarge
Posts: 11

Rep: Reputation: 0
Hi there I have a problem with GCC and redhat 9.0 along this line.

Ive just installed redhat (dev version) and am a linux noob. I know GCC is installed cos when I type gcc i get gcc:no input files

so Ive just written the standard hello world program:

#include <iostream.h>
int main(){
printf("Hello World!");
return(1);
}


when I call

gcc hello.c
I get
hello.c:1:22: iostream.h: No such file or directory

surely this should have been step up during the redhat installation ? if not what am i supposed to do?
 
Old 02-23-2005, 11:09 AM   #6
masand
Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 58
use

#include <iostream>
using namespace std;

and compile as

g++ file.cpp

this is for C++ programs
regards
 
Old 02-23-2005, 11:35 AM   #7
Tuetates
LQ Newbie
 
Registered: Feb 2005
Location: uk
Distribution: debian sarge
Posts: 11

Rep: Reputation: 0
Ok so Ive tried that and theres some improvement but no cigar as yet

I had another look at the code and changed it abit

hello.cpp now reads

#include <iostream>
using namespace std;
int main(){
cout<<"hello!";
return 0;
}


I run as described g++ not gcc

g++ hello.cpp

this produces a.out which is an improvement as there are now no errors!

however when I try to run a.out it does nothing in gnome or bash it outputs
bash: a.out: command not found

what am i doing wrong this time?
 
Old 02-23-2005, 12:50 PM   #8
masand
Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 58
in the same directory where u have compiled ur hello.cpp
run

./a.out

instead of

a.out

regards
 
Old 02-23-2005, 01:02 PM   #9
Tuetates
LQ Newbie
 
Registered: Feb 2005
Location: uk
Distribution: debian sarge
Posts: 11

Rep: Reputation: 0
great it worked!

cheers
 
Old 02-23-2005, 01:41 PM   #10
masand
Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 58
a.out could not work becasue u di not have that in path

if u run
env
u can see the PATH field where u can see what is ur path
generallu u have /bin,/sbin,/usr/bin,/usr/sbin
so

cp a.out /usr/sbin
and then run

a.out

and it will work just fine

regards
 
Old 02-23-2005, 02:31 PM   #11
Tuetates
LQ Newbie
 
Registered: Feb 2005
Location: uk
Distribution: debian sarge
Posts: 11

Rep: Reputation: 0
Ive run env like you said and /sbin isnt on in the path list.

I tried changing this

su
set path=/bin:/sbin......and others

but it didnt change. How did I do this?

Also I promise this is my last question for a week!
thanks for spending the time answering these noobie questions.
 
Old 02-23-2005, 02:51 PM   #12
masand
Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 58
hi there

since ur trying this a non root so the "env "will be different for u

so see what env u have and u can copy that a.out there

also u can run a.out by going to the directory where it is and by"./a.out"

i just wanted to tell u that when u run a.out then why it does not work

regards
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
install gcc and c compiler into RedHat Linux spykid Linux - Newbie 4 10-25-2006 05:35 AM
Redhat 9 GCC compiler HELP! (n00b here) Jaykay3k Linux - Software 5 02-21-2005 12:59 PM
installing make from a gcc rpm (yea i know im a n00b) wLancer Linux - Software 1 11-28-2004 09:50 PM
GCC compiler issues redhat 7.3 geogeer Linux - Newbie 5 04-16-2004 11:09 PM
GCC Compiler HELP Otaking Linux - Newbie 5 04-08-2004 06:17 PM


All times are GMT -5. The time now is 01:06 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration