LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 07-18-2007, 09:23 PM   #1
babyswan
LQ Newbie
 
Registered: Jul 2007
Posts: 22

Rep: Reputation: 15
Unhappy What are the commands to use to check whether the gcc compiler is working?


Hi there. I am doing a project on firmware and Linksys router. A intrusion detection device.
I was asked to use the gcc compiler to compiler codes.
However I am lost. I do not know how to use the gcc compiler at all. The internet research is not efficient enough.

Does anyone know what are the commands to test and check whether the gcc compiler is working?
How do I know whether the compiler is working? What are the commands to test that it works?
Do i also type the commands at the command shell prompt?
I hope someone replies me fast as no one is able to help me with this. I am feeling so stressed up right now because the project module points is a lot and I think i am failing this module.


Very much appreciated if some1 is able to help me! *sobz*
 
Old 07-18-2007, 09:31 PM   #2
babyswan
LQ Newbie
 
Registered: Jul 2007
Posts: 22

Original Poster
Rep: Reputation: 15
when i type gcc at the command shell prompt, it says no gcc....what does this mean?
I have already installed the gcc.4.1.2.tar.bz and i have already extracted it...isnt this the compiler??? I am so losttt as i do not have any knowlege of this.
helpppp !
 
Old 07-18-2007, 10:02 PM   #3
babyswan
LQ Newbie
 
Registered: Jul 2007
Posts: 22

Original Poster
Rep: Reputation: 15
sorry there is a typo error above, what i mean is when i typed gcc at the command shell prompt, it says bash command not found, something like this.
I head that there is a need to install a package but where am i able to find this package and how does it work with the gcc.2.1.4.tar.bz?

I really hope someone will be able to help me with this because i am very worried right now..my project deadline is in less than a mths time for now.
 
Old 07-18-2007, 10:18 PM   #4
chadl
Member
 
Registered: Sep 2005
Location: US
Distribution: Gentoo AMD64 Testing
Posts: 129

Rep: Reputation: 16
The best way to test GCC is to compile a simple C program. If the program compiled, then you know that GCC is working.

If you really want to install from a source tarball, the documentation for GCC is really well written... http://gcc.gnu.org/install/

Note that if you don't have any C++ compiler installed, then you will need to get a binary version of GCC, as you can't compile the source version of GCC without a compiler of some type. This is why I recommend using your distributions package manager. Binary versions for assorted platforms can be found at http://gcc.gnu.org/install/binaries.html if you can't use your package manager for whatever reason.

If you want more detailed help, you will need to put your distribution in your profile. I use Gentoo, so I don't frequently deal with systems that don't have GCC installed.

Last edited by chadl; 07-18-2007 at 10:21 PM.
 
Old 07-18-2007, 11:21 PM   #5
YouWillNverWalkAlone
LQ Newbie
 
Registered: Jul 2007
Posts: 7

Rep: Reputation: 0
how m i going to know the distro?because i m using a linux machine from the school.
 
Old 07-19-2007, 03:07 AM   #6
babyswan
LQ Newbie
 
Registered: Jul 2007
Posts: 22

Original Poster
Rep: Reputation: 15
hiii there thank you so much for respondinggg!!!!!

my distribution is redhat 9...
i am still unable to find the gcc package...
where am i be able to find this gcc compiler package and install it?
After that is there a need for further configuration?
 
Old 07-19-2007, 09:43 AM   #7
lazlow
Senior Member
 
Registered: Jan 2006
Posts: 4,362

Rep: Reputation: 172Reputation: 172
Support for Redhat9 was dropped more than four years ago. There are not updates available for it(of any kind). Your admin should update to a supported modern OS.
 
Old 07-19-2007, 08:35 PM   #8
chadl
Member
 
Registered: Sep 2005
Location: US
Distribution: Gentoo AMD64 Testing
Posts: 129

Rep: Reputation: 16
Do you have root on the box? If you don't, then you will not be able to install GCC (you can most likely run it, but it will be more complicated, esp if you are not sure about what you are doing in Linux). Because it is your schools system, chances are you will want to ask the System Administrator to install GCC.

If you do have root (and your system admin says its OK to install GCC), then you can install the RPM from the Red Hat 9 installation CD.

lazlow does have a point about RH9 being out of date; however. I would have said use the Red Hat FTP to get the latest version of GCC, but Red Hat has long since taken down the RH9 RPM FTP.
 
Old 07-19-2007, 09:14 PM   #9
babyswan
LQ Newbie
 
Registered: Jul 2007
Posts: 22

Original Poster
Rep: Reputation: 15
Yes I do have root in the system.
But I do not have the redhat 9 cd.
So that means there is no way I can install gcc now?
What will you advice me to do?
 
Old 07-19-2007, 10:05 PM   #10
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655
You might try finding packages and their dependencies at rpm.pbone.net. If you can find one package, look at the link for that package. That will most likely be a repository that you can add and then use your package manager to download and install files.
ftp://ftp.pbone.net/mirror/archive.d...2.2-5.i386.rpm

ftp://archive.download.redhat.com/pu...6/RedHat/RPMS/
 
Old 07-19-2007, 10:05 PM   #11
chadl
Member
 
Registered: Sep 2005
Location: US
Distribution: Gentoo AMD64 Testing
Posts: 129

Rep: Reputation: 16
Try installing this RPM:
ftp://archive.download.redhat.com/pu...2.2-5.i386.rpm
Do your own due diligence before installing this, as I have no way to test this, but it looks like the RH9 GCC RPM to me.

To install an RPM (as root):
Code:
rpm -ivh <rpm file name>
EDIT: Updated to use the redhat.com download site rather then the rpmseek.com one I had found before. Thanks to jschiwal for finding that.

Last edited by chadl; 07-19-2007 at 10:10 PM.
 
Old 07-19-2007, 10:24 PM   #12
babyswan
LQ Newbie
 
Registered: Jul 2007
Posts: 22

Original Poster
Rep: Reputation: 15
i am facing problems in opening the link.
once i click on the above link it will say cannot find server.
=(
 
Old 07-19-2007, 10:26 PM   #13
babyswan
LQ Newbie
 
Registered: Jul 2007
Posts: 22

Original Poster
Rep: Reputation: 15
ohhh ok sorry i am able to download it to my desktop in the linux computer already thank u very much. I will update the situation soon!
 
Old 07-19-2007, 10:36 PM   #14
babyswan
LQ Newbie
 
Registered: Jul 2007
Posts: 22

Original Poster
Rep: Reputation: 15
ok i am done with the installation of package thankx for the link. =)
Right now i am facing this problem:
when i type gcc at the command shell prompt, the output is as follows:

gcc: no input files

i am not sure what the above means.
But i have installed this gcc.2.1.4.tar.bz file which i know that it is the source codes for it. I have already untar it but how am i going to use it with the gcc compiler?
 
Old 07-19-2007, 10:42 PM   #15
chadl
Member
 
Registered: Sep 2005
Location: US
Distribution: Gentoo AMD64 Testing
Posts: 129

Rep: Reputation: 16
That is the normal output for GCC if you don't give it anything to do. If you give it some code to compile, it will compile it instead of telling you that there are no input files.

To give it a test:
Put this code in a file named test.c:
Code:
#include <stdio.h>
int main()
{
        printf("Hello World!\n");
        return 0;
}
Then run the following to compile it:
Code:
gcc test.c -o test
./test
If Hello World! is printed on your screen, then GCC is working correctly.

Last edited by chadl; 07-19-2007 at 10:48 PM.
 
  


Reply

Tags
gcc, rh9


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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
GCC compiler help!! LinuxNewbie999 Linux - Newbie 12 11-03-2006 01:03 AM
no gcc, no cc no c compiler pyrether DamnSmallLinux 5 09-09-2006 02:14 AM
How to check ARM Cross-Compiler MKSrivastava Debian 1 02-07-2006 03:39 AM
Passing commands to the compiler with ./cofigure Travis86 Linux - Software 5 10-16-2003 10:01 AM
Check it out: kernel auto-compiler zhenwu Linux - General 2 02-01-2002 04:33 AM


All times are GMT -5. The time now is 08:04 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