1、在linux终端:sudo apt-get install build-essential 安装编译环境
2、mkdir demos
3、touch hello.cc
4、gedit hello.cc
5、code:
#include
using namespace std;
int main()
{
cout<<"hello,world!"< return 0;
}
6、g++ hello.cc
7、./a.out
2、mkdir demos
3、touch hello.cc
4、gedit hello.cc
5、code:
#include
using namespace std;
int main()
{
cout<<"hello,world!"< return 0;
}
6、g++ hello.cc
7、./a.out
本文介绍如何在Linux环境下从安装编译环境开始,逐步创建并编译一个简单的C++程序。步骤包括使用sudo apt-get install build-essential安装必要的编译工具、创建项目文件夹及源代码文件、编写Hello World程序、编译源代码以及运行生成的可执行文件。
2819

被折叠的 条评论
为什么被折叠?



