如何在 Windows 7 中编译 C 编程? [英] How to compile C programming in Windows 7?
问题描述
我正在寻找在 Windows 7 上编译 C 程序的免费工具.过去我一直使用 gcc 在 Ubuntu 上编译 C 代码.那么,如何在 Windows 7 上编译 C 代码?请教我.:)
I am looking for free tools to compile C programs on Windows 7. I've always compiled C code on Ubuntu using gcc in the past. So, how can I compile C code on Windows 7? Please teach me. :)
推荐答案
MinGW 使用相当旧的 GCC 版本(我相信是 3.4.5),并且有一段时间没有更新.如果您已经对 GCC 工具集感到满意,并且只是想在 Windows 编程中涉足,那么这对您来说可能是一个不错的选择.有很多很棒的 IDE 都可以使用这个编译器.
MinGW uses a fairly old version of GCC (3.4.5, I believe), and hasn't been updated in a while. If you're already comfortable with the GCC toolset and just looking to get your feet wet in Windows programming, this may be a good option for you. There are lots of great IDEs available that use this compiler.
显然我错了;这就是我谈论我知之甚少的事情所得到的.Tauran 指出,有一个项目旨在为 MinGW 工具包提供当前版本的 GCC.您可以从 他们的网站 下载它.
Apparently I was wrong; that's what I get for talking about something I know very little about. Tauran points out that there is a project that aims to provide the MinGW toolkit with the current version of GCC. You can download it from their website.
但是,我不确定是否可以将它推荐给严肃的 Windows 开发.如果您不是一个无法忍受使用 Microsoft 软件的理想主义粉丝,我强烈建议您研究一下与 Microsoft 的 C/C++ 捆绑在一起的 Visual Studio编译器.Express 版本(包括与所有付费版本相同的编译器)完全免费下载.除了编译器之外,Visual Studio 还提供了世界一流的 IDE,使开发特定于 Windows 的应用程序变得更加容易.是的,批评者会喋喋不休地说它不完全符合标准,但这就是编写 Windows 应用程序的世界.一旦包含 windows.h
,它们就永远不会真正可移植,因此大多数理想主义的奉献最终都只是浪费时间.
However, I'm not sure that I can recommend it for serious Windows development. If you're not a idealistic fanboy who can't stomach the notion of ever using Microsoft software, I highly recommend investigating Visual Studio, which comes bundled with Microsoft's C/C++ compiler. The Express version (which includes the same compiler as all the paid-for editions) is absolutely free for download. In addition to the compiler, Visual Studio also provides a world-class IDE that makes developing Windows-specific applications much easier. Yes, detractors will ramble on about the fact that it's not fully standards-compliant, but such is the world of writing Windows applications. They're never going to be truly portable once you include windows.h
, so most of the idealistic dedication just ends up being a waste of time.
这篇关于如何在 Windows 7 中编译 C 编程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!