The following worked for me:
sudo apt-get install g++
The routine commands that saved me time after time for such errors:
sudo apt updatesudo apt upgradesudo apt install gcc python3-dev python3-pip libxml2-dev libxslt1-dev zlib1g-dev g++
Hope it works.
This link helped me to fix this issue.
You need to run below command to get g++ installed
yum install gcc-c++