What are the commands to use to check whether the gcc compiler is working?
Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
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*
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 !
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.
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.
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?
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.
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.
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?
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
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?
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.