我无法使用 g++ 命令编译 C++ 程序

shr*_*eya 4 compiling c++ g++ compiler

如果我尝试通过以下命令编译我的 C++ 源文件:

g++ a.cpp
Run Code Online (Sandbox Code Playgroud)

它输出:

The program 'g++' can be found in the following packages:
 * g++
 * pentium builder

try:
sudo apt-get intsall <<a>selected package>
Run Code Online (Sandbox Code Playgroud)

但是,如果我运行建议的命令 ( sudo apt-get install g++),它会显示一切都已安装。

那么,基本上,我如何在 Ubuntu 12.04 中编译一个简单的 C++ 程序?

Tac*_*ons 6

尝试这个

sudo apt-get update

sudo apt-get install build-essential