Could someone please tell me a sure-way of getting g++ and g++4.7 on to my Ubuntu? I have spent the whole day trying lots of sudo apt-get and nothing has worked.
When compiling from the IDE I am missing g++ as I get the compiler error:
“make[2]: g++: Command not found”
If I do:
sudo update-alternatives --config g++
it returns:
update-alternatives: error: no alternatives for g++.
If I do:
g++ --version
it returns:
The program 'g++' can be found in the following packages:
* g++
* pentium-builder
Try: sudo apt-get install <selected package>
I already have gcc 4.8 but I need g++ 4.7 (and possibly 4.8 if someone could advise me how I can download that?) because my code (which I did manage to compile with 4.7 earlier) is giving a compiler bug internal error.
(I havent been able to list every command I tried as there's been so many). There must be a way which definitely works
EDIT:
Have run to get g++ 4.6 so now when I call the g++ --version I get 4.6 showing. I then tried sudo apt-get install g++-4.7 to "upgrade" to 4.7 but this seemed to lose my g++ because I couldnt do g++ --version afterwards. I reverted back to 4.6. How can I upgrade to 4.7 and I really need to know how to get g++ 4.8?