C++ – Difference between Dev C++ and Visual C++


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

  • Dev C++ uses gcc, Visual C++ uses own compiler.
  • Any others?

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?

Best Solution

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.