MinGW 安装

时间:2022-07-22
本文章向大家介绍MinGW 安装 ,主要内容包括其使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。

一、概要

官网: http://www.mingw.org/ 下载安装地址: http://sourceforge.net/projects/mingw/files/ 下载 Installer 下面的 mingw-get-setup.exe

下载之后运行即可,这个是 获取安装包的 程序。


二、

之后,便可选择安装 GCC,GCC++,JAVA,Object-C 等编译器。

安装之后(默认安装路径 C:MinGWbin) ,便会看到很多 EXE 及 DLL 文件。然后将 C:MinGWbin 添加至 系统PATH

D:>gcc --version
gcc (GCC) 4.8.1
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

说明已经安装成功。

然后简单测试。

D:>vim a.c
#include <stdio.h>
int main(){
    printf("hello world!");
    return 0;
}
# 编译
D:>gcc a.c

# 执行
D:>a.exe
hello world!
D:>