2010-12-20 84 views
0

我在目录C:\MinGW中安装MinGW编译器套件,并设置PATH环境。我不知道任何项目中的用法,我想用编译器编译我的程序,但我不知道这些步骤。我如何使用GCC编译我的程序?MinGW编译器套件

+0

这里是[教程](https://www3.ntu.edu.sg/home/ehchua/programming/cpp/gcc_make.html) – 2016-01-06 10:34:55

回答

0

我通常从SourceForge using the automated installation安装MinGW的。

选择“mingw-get”。然后,一定要安装GCC C++编译器功能。要检查安装是否正常,请在命令行中输入“gcc -v”。您应该查看GCC版本。

如果不起作用,请检查您的系统路径。 “C:\ MinGW \ bin”应该正确配置。

要以简单快捷的方式开发您的应用程序,您可以下载用于Windows的Eclipse-CDT

Eclipse不需要任何安装。解压缩到您想要的目录并准备好工作。如果它不起作用,您可能需要先安装Java虚拟机。

Eclipse会自动检测您的MinGW安装,因此您不需要执行任何操作。

创建一个新的C项目(选择测试项目“Hello World”或编写自己的项目),然后编译并运行。

0
1. Download MinGW 
2. Check mingw folder exist in C drive. If it exist go to step 3. 
3. set environment variable in environment name "c:\mingw\bin" and press OK. 
4. Go to command Prompt type mingw-get install gcc 
5. after the installation of gcc, type powershell in command prompt. 
6. from powershell Browse to the folder where your source files are residing. 
7. type "gcc yourprogram.c", it will compile the source code 
8. type "./a.exe" you will get your output on console. Enjoy