哪个是最好的、标准的(希望是免费的)C++ 编译器?

发布于 2024-07-14 21:03:05 字数 571 浏览 5 评论 0原文

向 stackoverflow.com 致敬!

所以...我是一个 C++ 新手,目前正在学习数据结构这一主题,我想向你们咨询一些事情:

自从我开始学习系统工程以来,我一直在使用 Dev-C++ 的最新版本来完成我的所有工作。编程项目。 到目前为止,它已经很好地完成了它的工作,但它有一个致命的缺陷......试图在其中调试你的代码只是......非常痛苦! 每次你激活调试模式时,你都必须祈祷它不会在你正在观察的变量发生变化之前崩溃。

然后,我考虑使用微软的Visual-C++,因为它也是免费的; 然而,我问了我的老师并告诉我不要在课程中使用它,因为它不是标准的(其中编译的程序仅适用于Windows); 我们需要编写可以在 Windows 和 Linux 环境中编译的代码,并且一旦在任何环境中编译,就能够在这两种环境中使用该应用程序。

所以各位,我希望你们给我建议:哪个 C++ 编译软件有强大和/或稳定的调试模式,实现标准编译器(顺便问一下,它叫 g++ 吗??),并且希望它是免费的? ??

感谢您的关注。 Gracias y hasta luego ^_^(顺便说一句,第一篇文章快乐!!!^o^)

Saludos a todos en stackoverflow.com!!

So... I'm a C++ newbie currently taking the subject of Data Structures, and I want to consult something with you guys:

Since I started studying Systems Engineering, I've been using the last version of Dev-C++ for all my programming projects. It has done it's job well so far, but it has a FATAL flaw... trying to debug your code in it it's just... awfully painful!! Everytime you activate the debug mode you have to cross your fingers and hope it doesn't crash in your face just before the variable you are watching even changes.

Then, I though about using Visual-C++ from Microsoft, as it is free too; however, I asked my teacher and told me not to use it in the course, as it is not standard (compiled programs in it will only work for Windows); we are required to make code that can be compiled both in a Windows and Linux environment, and once compiled in any, being able to use the application on both environments.

So people, I want you to please give me advice: Which C++ compiling software out there has a strong and/or stable debugging mode, implements the standard compiler (is it called g++, by the way??), and it's hopefully free???

Thanks for your attention. Gracias y hasta luego ^_^ (BTW, happy first post!!! ^o^)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(9

债姬 2024-07-21 21:03:05

有一个用于 Windows 的 g++ 和 GDB(Gnu 调试器)实现,称为 Mingw,运行得非常好。 不过,由于我猜测您也在寻找图形 IDE/调试器,所以我会向您推荐 Eclipse。 eclipse 的 C 开发工具包括与 Mingw 构建工具和 GDB 的出色接口。 另外,关于您对 Windows 和 *nix 上使用的编译程序的评论,据我所知,这是不可能的。

There is an implementation of g++ and GDB ( the Gnu Debugger ) for windows called Mingw that works very well. Though since I'm guessing you're also looking for a graphical IDE / debugger, I'd point you at Eclipse. The C Development Tools for eclipse include an excellent interface to the Mingw build tools and GDB. Also, on your comment about a compiled program being used on both Windows and *nix, this is not possible as far as I know.

红玫瑰 2024-07-21 21:03:05

这取决于你所说的“标准”是什么意思。 无论如何,你都必须在 Linux 和 Windows 上编译你的代码。 没有办法创建可以在两者上运行的可执行文件。 只需在Windows上使用VS进行编译和调试,然后确保它在Linux上的GCC下也能编译和运行。

我认为他只是希望您在两者上使用相同的编译器,这样您就不必处理编译器之间的差异。 我认为这对你有好处。 编写可以在多个编译器上编译的代码很重要,因为它向您展示了标准的哪些部分真正是标准的。

It depends what you mean by 'standard'. You're going to have to compile your code on linux and windows anyway. There is no way to create and executable that will run on both. Just use VS to compile and debug on windows, then make sure it also compiles and runs under GCC on linux.

I think he just wants you to use the same compiler on both, so you don't have to deal with differences between compilers. I think that's good for you. Writing code that can compile on multiple compilers is important because it shows you what parts of the standard really are standard.

赠意 2024-07-21 21:03:05

Code::Blocks - 它是免费的,它是跨平台的,非常好。 您可以下载包含 CB IDE、MinGW C++ 编译器和 gdb 调试器的软件包。 安装非常简单。

Code::Blocks - it's free, it's cross-platform, it's pretty good. You can download a package consisting of the CB IDE, the MinGW C++ compiler and the gdb debugger. Installation is very straightforward.

能否归途做我良人 2024-07-21 21:03:05

听起来您需要一个 IDE(集成开发环境)。

Eclipse 可能对你有好处。 Windows 和 Linux 均支持它。

http://www.eclipse.org/cdt/

It sounds like you're asking for an IDE ( Integrated Dev Environment ).

Eclipse might be good for you. It's supported on both Windows and Linux.

http://www.eclipse.org/cdt/

乱了心跳 2024-07-21 21:03:05

就编译器本身而言,GCC 是您最好的选择。 它是一个最纯粹意义上的编译器,尽管它没有本地接口。

我会寻找一个可以依附于此的良好发展环境。

与我个人目前对 IDE 的偏好不同的是 Eclipse,但这确实是个人的事情。

In terms of compilers themselves GCC is your best bet. It is a compiler in the purest sense of the word though it doesn't have a native interface to it.

I would be looking at finding a good environment to develop in that could attach to it.

Straying from that my personal preference in IDE's right now is eclipse, but that is really a personal thing.

遮了一弯 2024-07-21 21:03:05

如果仅使用 C++ 的标准功能,则可以使用 Visual Studio Express C++。 您没有义务使用编译器的仅限 Windows 扩展:MFC、ATL、Wizards 等。

但如果您想让某些东西可移植,那么尝试针对两个编译器(GCC 和 VS)确实是一个更好的练习。

最近诺基亚还发布了一个新的多平台IDE QtCreator,它是第一个版本,但至少值得考虑。

If you use only the standards features of C++, you can use Visual Studio Express C++. Your are not obligated to use the windows only extension of the compiler: MFC, ATL, Wizards, etc.

But if you want to make something portable then trying to target both compilers (GCC and VS) is really a better exercise anyway.

Also recently Nokia released a new multiplataform ide QtCreator, it is a first version but at least it deserve to be taken in consideration.

两仪 2024-07-21 21:03:05

MinGW 与 @Colfax 状态相当好。 考虑将 ddd 与 Cygwin 一起使用,这使得使用 gdb 更加容易。 请参阅这个SO问题

但是等等... Qt 4.5 现在不是作为 LGPL 发布的,使它成为一个很棒的免费工具吗? 请参阅此处

MinGW is pretty good as @Colfax state. Consider using ddd with Cygwin which makes using gdb somewhat easier. See this SO question

But wait...isn't Qt 4.5 released as LGPL now making that a great free tool? See here

画中仙 2024-07-21 21:03:05

作为一个 Linux 爱好者,我认为最好的体验是使用 GVIM 作为编辑器,使用 Mingw 作为编辑器
编程环境。 GCC 是标准,但 LLVM-GCC 非常有前途,并且附带可在 Windows 中使用的 Mingw 版本。

As a linux guy, I think the best experience comes with GVIM as editor and Mingw as
programming environment. GCC is the standard, but LLVM-GCC is very promising and comes with a Mingw build ready for use in windows.

指尖微凉心微凉 2024-07-21 21:03:05

当我开始学习编程时,我就使用 DevC++。 我喜欢它。 只是无法更改为另一个编译器,所以我使用 wxDevC++,一个仍在维护的 DevC++ 版本。

I use DevC++ from when i was starting learn to programm. And i love it. Just can't change to another compiler, so i use wxDevC++ a still maintained version of DevC++.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文