1. 首先安装g++
sudo apt-get install build-essential
2. 输入一个简单的cpp程序
#include
using namespace std;
int main()
{
cout <<"Hello Ubuntu!" <
}
3. 编译
www.linuxidc.com@ubuntu:~/MyTrain/CPlus$ g++ -o hello.exe hello.cpp
4. 运行
www.linuxidc.com@ubuntu:~/MyTrain/CPlus$ ./hello.exe
5. 结果
Hello Ubuntu!