简体   繁体   English

适用于Windows的良好的c / c ++编译器

[英]good c/c++ compiler for windows

Does anyone know of ac/c++ compiler that is easily usable with windows? 有没有人知道可以轻松使用Windows的ac / c ++编译器? I have a bit of experience with gcc, but I would like to take a crack at developing some code like this on a windows machine. 我对gcc有一些经验,但我想在Windows机器上开发一些像这样的代码。 Many of the compilers I have seen look a bit complex, or are not for windows. 我见过的许多编译器看起来有点复杂,或者不适用于Windows。

Thanks in advance. 提前致谢。

Usually on windows the mentality is a bit different. 通常在Windows上心态有点不同。 Rather than worrying about a compiler, you worry about getting a good IDE that does all that for you. 而不是担心编译器,你担心得到一个好的IDE,为你做所有这些。

As a result, Visual Studio is the best option. 因此,Visual Studio是最佳选择。

Visual Studio Express Visual Studio Express

MingW (which is gcc IIRC) MingW(gcc IIRC)

Cygwin with the proper packages. Cygwin有适当的包裹。

g++ is available on Windows as MinGW . g++在Windows上可用作MinGW Alternatively, Microsoft Visual Studio is also an option (the Express version is free.) 或者, Microsoft Visual Studio也是一个选项(Express版本是免费的。)

Microsoft Visual C ++ Express版:它很好而且免费!

If you prefer open source and a IDE+compiler-package which is updated more frequently than Visual Studio (this is interesting in times of a new, nowhere fully implemented standard), then this list might be for you: 如果您更喜欢开源和IDE +编译器包,它比Visual Studio更频繁地更新(这在新的,无处完全实现的标准时很有趣),那么这个列表可能适合您:

  • QtCreator + MinGW QtCreator + MinGW
  • CodeBlocks + MinGW CodeBlocks + MinGW
  • Eclipse + MinGW Eclipse + MinGW

Above is also interesting if you want to learn recent OpenMP versions. 如果您想了解最近的OpenMP版本,上面也很有趣。 ( Microsoft seems still not interested in OpenMP 3.x , but instead seems to want to invent yet another parallel framework (as if there is not TBB and/or OpenMP already)) 微软似乎仍然对OpenMP 3.x不感兴趣 ,但似乎想要发明另一个并行框架(就好像已经没有TBB和/或OpenMP))

If you don't know where to start, download and install visual studio express from microsoft's website. 如果您不知道从哪里开始,请从microsoft的网站下载并安装visual studio express。

Does anyone know of ac/c++ compiler that is easily usable with windows? 有没有人知道可以轻松使用Windows的ac / c ++编译器?

Define "easy". 定义“简单”。 As far as I know all compilers are easy to use once you learned how to use decent build system and have toolchain running. 据我所知,一旦你学会了如何使用体面的构建系统并运行工具链,所有编译器都很容易使用。

Two main compilers available on windows platform are Microsoft Compiler (Visual Studio express) and MinGW+GCC. Windows平台上提供的两个主要编译器是Microsoft Compiler(Visual Studio express)和MinGW + GCC。 There are others (openwatcom/borland c++ builder come to mind), but they are less "popular". 还有其他人(想到openwatcom / borland c ++ builder),但它们并不那么“受欢迎”。

To effictively develop you need 3 main components: 要有效地开发,您需要3个主要组件:

  1. Compiler. 编译器。 (microsoft compiler, gcc, intel compiler, etc) (微软编译器,gcc,intel编译器等)
  2. Build system. 建立系统。 (gnu make, scons, cmake, qmake, msbuild, visual studio) (gnu make,scons,cmake,qmake,msbuild,visual studio)
  3. Programmer's text editor. 程序员的文本编辑器。 (jedit, visual studio, notepad++, far manager, midnight commander, vim, emacs). (jedit,visual studio,notepad ++,远程经理,午夜指挥官,vim,emacs)。

As you can see, there are many possible combinations. 如您所见,有许多可能的组合。 For me using gnu command line utilities (from msys) with qmake and visual studio on windows platform turned out to be the most efficient setup. 对于我来说,在Windows平台上使用gnu命令行实用程序(来自msys)与qmake和visual studio被证明是最有效的设置。

The main advantage of "all in one" packages like visual studio express is that it installs all 3 components at once. 像visual studio express这样的“一体化”软件包的主要优点是它可以同时安装所有3个组件。 Disadvantage of such package is that a beginner won't understand how program is being built, and as a result newbie won't discover more efficient setup any time soon. 这种软件包的缺点是初学者不会理解程序是如何构建的,因此新手不会很快发现更有效的设置。

You can try Dev-C++ along with mingw. 您可以尝试使用Dev-C ++和mingw。 Although, it's like an ant among lions, but it is still the best. 虽然,它就像狮子中的蚂蚁,但它仍然是最好的。

As far as problems like having an older mingw is present, why not get a new one and change some settings. 至于存在较旧的mingw等问题,为什么不换新的并改变一些设置。 But yes, if u are old school or don't like ides try, Notepad 但是,是的,如果你是老学校或不喜欢ides尝试,记事本

Best options IMHO: 最佳选择恕我直言:

  • Visual c++ Express (best support for Windows development) Visual c ++ Express(Windows开发的最佳支持)
  • Eclipse (with CDT) + MinGW (best if you want portable code) Eclipse(带CDT)+ MinGW(如果你想要可移植代码,最好)
  • Netbeans + MinGW (similar to above) Netbeans + MinGW(类似于上面)

I have been using OpenWatcom (previously simply Watcom) for close to twenty years and am very pleased with it. 我已经使用OpenWatcom(以前只是Watcom)近二十年了,我对它非常满意。 The IDE is simple but effective, as is the debugger. IDE是简单但有效的,调试器也是如此。

There are some things you should know though: 你应该知道一些事情:

  • It does not produce 64-bit x86 code 它不会产生64位x86代码
  • The C++ component is for all practical purposes non-existent C ++组件实际上并不存在
  • The root watcom directory cannot reside in a path which contains spaces (ie it can't be placed in "Program Files") so I place it in "Programx" - this quirk may have been fixed 根watcom目录不能驻留在包含空格的路径中(即它不能放在“Program Files”中)所以我把它放在“Programx”中 - 这个怪癖可能已经修复了
  • I am not sure whether included file functionality can handle embedded spaces in paths either - this may also have been fixed 我不确定包含文件功能是否可以处理路径中的嵌入空间 - 这也可能已得到修复

Tuned C code translated with the Watcom compiler is right up there with the best, especially multi-threaded code. 使用Watcom编译器翻译的Tuned C代码就是最好的,特别是多线程代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM