Reputation: 923
What are the differences between Dev C++ and 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.
Does anyone have any ideas why?
Upvotes: 4
Views: 29804
Reputation: 2309
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.
Applications can also be developed with Dev C++, but its a lot of work configuring the libraries and so on.
The reason your application didnt compile with Dev C++, is because the libraries might not be configured properly with Dev C++.
Upvotes: 0
Reputation: 882146
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.
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.
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.
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 :-).
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 :-)
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.
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.
Upvotes: 3
Reputation:
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.
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.
Upvotes: 0
Reputation:
I can second the Code::Blocks recommendation. It's like an open source version of VC++ 6.0, which was probably the highpoint of the VC++ IDEs.
Regarding your question - you need post some code and/or the error messages you are getting.
Upvotes: 0