Dev C++ 和 Visual C++ 之间的区别

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/549979/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-27 15:53:37  来源:igfitidea点击:

Difference between Dev C++ and Visual C++

c++

提问by WoW

What are the differences between Dev C++ and Visual C++?

Dev C++ 和 Visual C++ 之间有什么区别?

  • Dev C++ uses gcc, Visual C++ uses own compiler.
  • Any others?
  • Dev C++ 使用 gcc,Visual C++ 使用自己的编译器。
  • 还有其他人吗?

Correct me if I'm wrong.

如果我错了纠正我。

I tried to compile a program written in Visual C++ with Dev C++ and it didn't work.

我试图用 Dev C++ 编译一个用 Visual C++ 编写的程序,但没有成功。

Does anyone have any ideas why?

有谁知道为什么?

回答by paxdiablo

You need to show us the code, we can't offer any really specific advice without knowing more detail on what you're doing. You touched upon one of the differences between MS Visual C++ and Dev C++ (and its cousins also using GCC under the covers). See final two paragraphs for my suggestions.

您需要向我们展示代码,如果不了解您在做什么的更多细节,我们无法提供任何真正具体的建议。您提到了 MS Visual C++ 和 Dev C++ 之间的差异之一(及其表亲也在幕后使用 GCC)。我的建议见最后两段。

However, standard C++ programs should compile and run in either so, if you're having troubles, it's likely because you're using some Microsoft-provided stuff that's not in Dev C++. I don't know what this is since I've never used Dev C++ but my first thoughts would be MFC or Win32 API calls.

但是,标准 C++ 程序应该可以编译和运行,如果您遇到问题,很可能是因为您使用了一些不在 Dev C++ 中的 Microsoft 提供的东西。我不知道这是什么,因为我从未使用过 Dev C++,但我的第一个想法是 MFC 或 Win32 API 调用。

Dev C++ should be able to link to the Microsoft libraries but you may need to configure that. Visual C++ will almost certainly make that an easily-configured option (or the default) but you'll probably have to work harder to achieve it in a non-MS product.

Dev C++ 应该能够链接到 Microsoft 库,但您可能需要对其进行配置。Visual C++ 几乎肯定会使其成为易于配置的选项(或默认选项),但您可能需要更加努力地在非 MS 产品中实现它。

If you really want to develop programs easily and you're less concerned with free-as-in-speech as opposed to free-as-in-beer software, get your hands on a copy of Visual C++ Express. It's basically the Microsoft IDE for learning purposes at zero cost and you'll find it a more polished product than the others - this is my opinion, others will argue otherwise and they may be right, that's why it's an opinion :-).

如果您真的想轻松地开发程序,并且您不太关心言论自由而不是啤酒中的自由软件,请获取一份 Visual C++ Express 副本。它基本上是用于零成本学习目的的 Microsoft IDE,您会发现它比其他产品更精致 - 这是我的观点,其他人会反驳,他们可能是对的,这就是为什么它是一种观点:-)。

I tend to use the VS2010 Professional package nowadays simply because MS goes out of their way to make it a polished product and I don't mind paying for it since I, in turn, get paid well for my work :-)

我现在倾向于使用 VS2010 Professional 软件包,只是因为 MS 不遗余力地使其成为一款精美的产品,而且我不介意为此付费,因为反过来,我的工作获得了丰厚的报酬:-)

If you're more concerned with free-as-in-speech, then Dev C++, Code::Blocks, Eclipse CDT and others, are probably all excellent environments. If you're a beginner, you may need help setting them up for nice debugging or accessing Microsoft libraries but it's well worth it in my opinion. Eclipse was my favorite simply because I used to do a lot of Java at work and I'm familiar with it but everyone seems to rave about Code::Blocks for C++ work. Having had a play, it's very easy to get used to.

如果您更关心言论自由,那么 Dev C++、Code::Blocks、Eclipse CDT 等可能都是极好的环境。如果您是初学者,您可能需要帮助设置它们以进行良好的调试或访问 Microsoft 库,但在我看来这是非常值得的。Eclipse 是我的最爱,因为我曾经在工作中做过很多 Java 并且我很熟悉它,但似乎每个人都对用于 C++ 工作的 Code::Blocks 赞不绝口。玩过,很容易适应。

And re-iterating my advice for the "it didn't work" part of your question, you should show us the code or the errors that you're getting - it may be blindingly obvious to us once we've seen them.

并重申我对您问题中“它不起作用”部分的建议,您应该向我们展示代码或您遇到的错误 - 一旦我们看到它们,这对我们来说可能是显而易见的。

回答by paxdiablo

I can second the Code::Blocksrecommendation. It's like an open source version of VC++ 6.0, which was probably the highpoint of the VC++ IDEs.

我可以支持Code::Blocks推荐。它就像 VC++ 6.0 的开源版本,这可能是 VC++ IDE 的亮点。

Regarding your question - you need post some code and/or the error messages you are getting.

关于您的问题 - 您需要发布一些代码和/或您收到的错误消息。

回答by John T

Visual C++ uses a common header file for applications made in that environment called stdafx.h (which stands for STandard Application Framework eXtensions). This is probably one of the main reasons it would not compile. Visual C++ is also a much more complete IDE for windows development. The debugger works wonders and is very well integrated in the IDE.

Visual C++ 为在该环境中创建的应用程序使用一个公共头文件,称为 stdafx.h(代表标准应用程序框架扩展)。这可能是它无法编译的主要原因之一。Visual C++ 也是用于 Windows 开发的更完整的 IDE。调试器效果很好,并且很好地集成到了 IDE 中。

Dev on the other hand is great for starting out. It hasn't been updated in a long time, but for beginners this is great - there are less features there to overwhelm them. Although once developers move on, such features are basically a necessity for productivity enhancement.

另一方面,Dev 非常适合入门。它已经很长时间没有更新了,但对于初学者来说这很棒 - 那里的功能较少,无法压倒他们。尽管一旦开发人员继续前进,这些功能基本上是提高生产力的必要条件。

回答by barryjones

Visual C++ is from Microsoft. It supports plain C++ in addition to windows libraries [MFC, COM, Win32]. If you want to develop applications for windows and want to do it faster use Visual Studio.

Visual C++ 来自微软。除了 Windows 库 [MFC、COM、Win32] 之外,它还支持普通 C++。如果您想为 Windows 开发应用程序并希望更快地完成,请使用 Visual Studio。

Applications can also be developed with Dev C++, but its a lot of work configuring the libraries and so on.

应用程序也可以使用 Dev C++ 开发,但需要大量的工作来配置库等。

The reason your application didnt compile with Dev C++, is because the libraries might not be configured properly with Dev C++.

您的应用程序没有使用 Dev C++ 编译的原因是因为这些库可能没有使用 Dev C++ 正确配置。