![如何安装 g++ 编译器?](https://linux22.com/image/1043128/%E5%A6%82%E4%BD%95%E5%AE%89%E8%A3%85%20g%2B%2B%20%E7%BC%96%E8%AF%91%E5%99%A8%EF%BC%9F.png)
我尝试了以下方法:
sudo apt-get install build-essential
Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
但是当我编译时终端显示以下内容:
g++ hello.cpp -o hello
The program 'g++' can be found in the following packages:
* g++
* pentium-builder
Try: sudo apt-get install <selected package>
我应该怎么办?
答案1
答案就在你的问题里:
Try: sudo apt-get install <selected package>
就你的情况而言:
sudo apt-get install g++