其中MinGW的文件作为C ++编译器使用 [英] Which MinGW file to use as a C++ compiler

查看:144
本文介绍了其中MinGW的文件作为C ++编译器使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚安装MinGW和bin文件夹,我可以看到7的.exe文件编译我的程序:

I have just installed MinGW and in the bin folder I can see 7 .exe files that compile my program:


  1. C ++。exe文件

  2. 先按g ++。exe文件

  3. 的mingw32-C ++。exe文件

  4. 的mingw32-G ++。exe文件

  5. gcc.exe

  6. 的mingw32-gcc.exe

  7. 的mingw32-GCC-4.4.1.exe

我的小程序(testprog.cpp)与他们每个人的编译正确;在 A.EXE 文件在bin文件夹中生成并运行正常。

My small program (testprog.cpp) compiles correctly with each of them; the a.exe file is generated in the bin folder and it runs correctly.

有什么他们,我应该使用哪一个区别?
另外,我能做些什么来改变从a.exe的输出文件的名称后,每一个成功的编译自动testprog.exe?

What's the difference between them and which one should I use? Also, what can I do to change the name of the output file from a.exe to testprog.exe automatically upon each successful compile?

推荐答案

这是很可能的,他们都是一样的;无论是精确副本或符号链接到另一个。尝试使用 - 每个版本标记,看看你有什么。在我MingGW安装在这里,其中每个二进制文件不同的(检查与差异),但它们都输出相同的版本信息(在第一位的例外,这是文件名):

It's quite possible that they are all the same; either exact copies or symbolic links to one another. Try using the --version flag on each to see what you've got. On my MingGW installation here, each of those binaries differs (checked with diff), but they all output the same version information (with the exception of the first bit, which is the filename):

gcc.exe (GCC) 3.4.5 (mingw-vista special r3)
Copyright (C) 2004 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.

使用 -o 标志来改变输出文件的名称:

Use the -o flag to change the output file name:

gcc -o testprog.exe testprog.cpp

这篇关于其中MinGW的文件作为C ++编译器使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆