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: [*.o] Error 127 make: Leaving directory
It looks like you need to install g++. This is available via
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
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
yum in any of the previous commands and you'll get the same results.
The C++ compiler, g++, is either not installed or not available via the PATH environment variable.
Try installing the C++ compiler.