Reputation: 691
I'm using ubuntu 16.04 and I have g++ installed:
~$ sudo apt install g++
Reading package lists... Done
Building dependency tree
Reading state information... Done
g++ is already the newest version (4:5.3.1-1ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
However, when I try to use it to compile, or if I just call it, I receive an error message stating that g++ is not installed.
~$ g++
The program 'g++' is currently not installed. You can install it by typing:
sudo apt install g++
I already tried apt update
and apt upgrade
but nothing changes. Build essential package is also installed:
~$ sudo apt-get install build-essential
Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version (12.1ubuntu2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
How can I have g++ working?
Upvotes: 1
Views: 330
Reputation: 385144
Something is wrong with the installation, or it has since been modified/broken.
Reinstall it.
sudo apt-get install --reinstall g++
Upvotes: 2