简体   繁体   English

为C ++设置窗口

[英]Setting up windows for C++

To quote the FAQ, 'No question is [...] too "newbie"' 引用常见问题,“毫无疑问,“新手”也是如此。

What is the best way to set up an Windows system (vista, if that matters) to work with C++? 设置Windows系统以使用C ++的最佳方法是什么?

Preferably with a nice IDE, easy compiling of software (support for make files, etc.), but suitable for a beginner. 最好使用一个不错的IDE,易于编译软件(支持make文件等),但适合初学者。

I would quite like the IDE to use a relatively portable format, such as makefiles and configure scripts, nothing too proprietary. 我非常希望IDE使用相对可移植的格式,例如makefile和configure脚本,没有什么太专有的。

I would also like the ability to add new libraries etc. without much hassle, and work with the majority of C++ code others have written. 我还希望能够轻松添加新库等,并能与其他人编写的大多数C ++代码一起使用。

I am comfortable using the command line. 我很喜欢使用命令行。

Thanks for the help, hopefully the question is clear. 感谢您的帮助,希望这个问题很清楚。 And apologies if it's already been answered, i did have a look for similar questions. 抱歉,如果已经回答了,我确实在寻找类似的问题。

I know this is not exactly 'nothing to proprietary' but you should give a look at the free Express Edition of Visual C++ . 我知道这并不完全是“专有”,但是您应该看一下免费的Visual C ++ Express Edition Under its covers you'll get all the familiar make and command line tools, but wrapped in a polished IDE. 在它的底下,您将获得所有熟悉的制造和命令行工具,但包装在优美的IDE中。

If you're really comfortable with the command line then you can make an IDE from code editor on top of a compiler/debugger suite. 如果您真的对命令行感到满意,则可以在编译器/调试器套件的顶部通过代码编辑器创建IDE。 MS's own command line tools come with the platform SDK (free) and you get an awesome debugger in Windbg . MS自己的命令行工具随平台SDK一起提供 (免费),您将在Windbg中获得出色的调试器。 My personal favorite code editor is Code Insight . 我个人最喜欢的代码编辑器是Code Insight I wish so hard for a Mac version /sigh. 对于Mac版本,我希望如此努力。

Microsoft's Visual Studio has a free express edition which contains pretty much everything you need to program c++. 微软的Visual Studio有一个免费的快速版,其中包含您编写C ++所需的几乎所有内容。
For a Gui, the main choices are probably, MFC (old and ugly), CLR/.Net (new and confusing) or look at Qt(now LGPL) or wxWigets 对于Gui来说,主要选择可能是MFC(旧的和丑陋的),CLR / .Net(新的和令人困惑的)或查看Qt(现为LGPL)或wxWigets

There are quite a few good IDEs for C++ available on Windows. Windows上有很多不错的C ++ IDE。

The de-facto standard for professional software development is Microsoft's Visual Studio , which is available in different versions, like the free Express Editions . 专业软件开发的事实上的标准是Microsoft的Visual Studio ,它有不同的版本,例如免费的Express Edition This will give you a great tool-chain for Windows development. 这将为您提供Windows开发的出色工具链。

However, for a more "cross-platform" approach, you should have a look to the free Eclipse C++ Development Tooling , which is available for many platforms. 但是,对于更“跨平台”的方法,您应该看看免费的Eclipse C ++开发工具 ,该工具可用于许多平台。 As long as your own code is platform-independent, the whole project can be shared between Windows, Linux, Mac, etc. 只要您自己的代码独立于平台,就可以在Windows,Linux,Mac等之间共享整个项目。

Other alternatives are MinGW or CygWin that both allow to use the GCC toolchain on Windows. 其他替代方法是MinGWCygWin ,它们都允许在Windows上使用GCC工具链。

Try the MinGW compiler , it will come with a C and C++ compiler, Make, etc--among many others. 尝试使用MinGW编译器 ,它将附带C和C ++编译器,Make等-以及许多其他编译器。 This can be used from the command line, pretty easily: g++ -o someprogram.exe somecode.cpp 可以从命令行轻松地使用它: g++ -o someprogram.exe somecode.cpp

As for an IDE, there are lots out there. 至于IDE,还有很多。 Right now I am using Code::Blocks , and so far it's been really nice. 现在,我正在使用Code :: Blocks ,到目前为止,它真的很棒。 As well, it already supports the GCC compiler, and sets many of the appropriate flags for you, so all you'll really need to do is hit the "build" button. 同样,它已经支持GCC编译器,并为您设置了许多适当的标志,因此您真正需要做的就是点击“ build”按钮。

Some others you might want to try are Eclipse, which is really powerful, but lots of its "power" will be really confusing and difficult to use until you start getting used to it. 您可能想尝试的其他一些工具是Eclipse,它确实很强大,但是它的许多“功能”在您开始习惯它之前,确实会令人困惑且难以使用。 Visual C++ is another one, which (obviously) would integrate very nicely into Windows. Visual C ++是另一种,(显然)它将很好地集成到Windows中。 Of course, you could always use emacs :) 当然,您可以始终使用emacs :)

我建议您评估CodeBlocks

Microsoft's Visual Studio is powerful but rather proprietary. 微软的Visual Studio功能强大,但专有。 If you prefer open/portable stuff, I recommend Dev-C++ and Cygwin . 如果您喜欢开放式/便携式的东西,我建议使用Dev-C ++Cygwin

FWIW, I recently went through this and tried the VC++ Express and QT Creator based stuff. FWIW,我最近经历了这一过程,并尝试了基于VC ++ Express和QT Creator的东西。 Coming from a linux/unix background I found that QT was a little better since it was using the Ming compilers and some make based constructs. 来自linux / unix背景,我发现QT更好一点,因为它使用的是Ming编译器和一些基于make的构造。

If you will only be hacking for windows I would go for Visual Studio. 如果您只想破解Windows,那我就去Visual Studio。 It will definitely save you time you can spend on coding instead. 绝对可以节省您可以花在编码上的时间。 Most open source out there for windows either already have VC project, and if they don't it is usually very simple to set one up. 用于Windows的大多数开放源代码已经有VC项目,如果没有,则通常很容易设置一个项目。 And normally they have either make or nmake files for you to build VC compatible libararies to link with. 通常,它们具有make或nmake文件供您构建要链接的VC兼容库。

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

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