linux gcc 编译入门一:编译helloworld
linux-dash
A beautiful web dashboard for Linux
项目地址:https://gitcode.com/gh_mirrors/li/linux-dash

·
环境安装(linux 系统下)
安装gcc :
sudo apt-get install gcc
安装g++:
sudo apt-get install g++
安装vim(估计都有):
sudo apt-get install vim
hello world编译
编辑helloworld.c
#include <stdio.h>
int main(){
printf("hello world");
return 0;
}
很简单的hello world 打印。
编译命令为:
gcc -Wall -o helloworld helloworld.c
生成helloworld可执行文件。
执行:
./helloworld
就会打印 "hello world"
参数:
-o 是输出参数,输出名字的参数,如果不加-o 参数。命令:gcc helloworld.c 则会生成a.out的可执行文件。
-Wall 编译后显示所有警告。




A beautiful web dashboard for Linux
最近提交(Master分支:5 个月前 )
186a802e
added ecosystem file for PM2 4 年前
5def40a3
Add host customization support for the NodeJS version 4 年前
更多推荐
所有评论(0)