1.验证有无安装gcc
win+r 调出Run,输入cmd,调出cmd窗口
输入
g++ -v
2安装
在https://sourceforge.net/projects/mingw/
下载MinGW,minimalist GUN for windows
GUN-Gun’s not unix
GCC-GNU Compiler Collection
在MinGW的列表中,勾选希望安装的文件包,然后在菜单中选择Updata Catalogue
设置环境变量,我的电脑->propertise->advanced system setting->Enviroment Variables->User variables->Path->edit->
加入C:\MinGW\bin
该目录下有刚刚安装的gcc.exe g++.exe文件
返回步骤1验证是否安装成功
3编译
写代码存为helloworld.c
#include<stdio.h>
int main()
{
printf(“hello ,world!\n”);
return 0;
}
然后编译运行