1. 首先安装g++

  sudo apt-get install build-essential

 

2. 输入一个简单的cpp程序

#include <iostream>
using namespace std;
int main()
{
    cout << "Hello Ubuntu!" << endl;
    return 0;
}

 

3. 编译

  david@ubuntu:~/MyTrain/CPlus$  g++ -o hello.exe hello.cpp

 

4. 运行

  david@ubuntu:~/MyTrain/CPlus$ ./hello.exe

5. 结果

  Hello Ubuntu!

 

相关文章:

  • 2021-07-20
  • 2021-11-01
  • 2022-12-23
  • 2022-12-23
  • 2021-09-12
  • 2021-06-02
  • 2021-11-09
  • 2022-12-23
猜你喜欢
  • 2021-12-16
  • 2022-12-23
  • 2021-12-05
  • 2022-03-02
  • 2022-03-06
  • 2021-06-08
  • 2021-12-31
相关资源
相似解决方案