How do I install g++ for Fedora?

Solution 1:

The package you're looking for is confusingly named gcc-c++.

Solution 2:

instead of g++ you have to write gcc-c++

sudo dnf install gcc-c++