Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to compile a c++ program in Fedora Linux, but the program isn't compiled correctly. I got the following error:

/bin/sh: g++: command not found
make[1]: [*.o] Error 127 
make[1]: Leaving directory


share|improve this question

It looks like you need to install g++. This is available via dnf:

dnf install gcc-c++

In the future, if you see any variant of a command not found error, you can search for the package that provides the "command" with

dnf whatprovides \*/bin/<command>

It used to be that you could just say whatprovides <command> but Fedora now wants the full path to the binary that you're looking for. Since we don't know it, we use prepend \*/bin to look in all bin directories.

Note that dnf is a replacement for yum and became the default package manager in Fedora 22. If you're on an early version of Fedora, you can replace dnf with yum in any of the previous commands and you'll get the same results.

share|improve this answer
You may also want to do sudo yum group install "Development Tools" – hobs Nov 6 '14 at 15:33

The C++ compiler, g++, is either not installed or not available via the PATH environment variable.

Try installing the C++ compiler.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.