0

I have wrote a c program in gedit and opened terminal where the following symbol shown as

>

and now i tried to execute the program as

gcc filename.c

and am getting the output as

gcc: command not found

what is the error in doing this application?

3 Answers 3

2

That means that gcc is not installed. The steps for installing it depend on which Linux distro you are using. For Debian-based systems, you should try

sudo apt-get install build-essential

For Red Hat-based systems, try

sudo yum install gcc
Sign up to request clarification or add additional context in comments.

Comments

1

You need to install gcc. Try sudo apt-get install gcc (actually, sudo apt-get install build-essential is a better idea), or sudo yum install gcc.

Comments

1

Given that you're using gedit, I'm going to infer that you're running on some Linux system.

To clarify, what you tried to do with this command...

gcc filename.c

.. was to compile your program, filename.c. After executing this command successfully you would then need to run the compiled executable, which by default would be named a.out.

As per the other poster, the most likely cause of the error in invoking gcc is that you don't have the compiler installed. If you're running on Ubuntu or another Debian-based distro you can install gcc with apt-get; on other distributions like SuSE or Red Hat you can use yum.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.