What is the difference between Borland, GCC and MinGW compilers?
I have been programming for a while at an intermediate level of course. I have been executing the same code in these different compilers (mostly开发者_开发技巧 GCC and MinGW), but I'm unable to make out the difference between these compilers. I mean by what way is the one better than the other? Or what makes them different? Are there some special needs where you might want to use GCC and for others maybe MinGW?
MinGW and GCC are really the same compiler underneath. MinGW is a GCC port for the Windows platform.
The reasons why you would use different compilers (as in, based on different front-ends) are:
- You have a binary-only library that is guaranteed to play nice only if you use particular compilers and those happen to be different compilers for different platforms
- You need to target multiple platforms, and there is no compiler that targets all your platforms
- You have legacy code that uses particular compiler extensions on different platforms.
When in doubt, use gcc. It is a venerable, old and well tested compiler that's free and used a lot, particulary in Linux space. minGW is a port of some GNU development utilities for Windows, including gcc.
I haven't used Borland's compiler. Ideally, your programs compiled with it should run exactly like when they're compiled using gcc.
Gcc and Borland basically do the same thing. Simplified, they take source code files as input and spit out executables as output. Their internal implementation is vastly different, but that shouldn't be your concern.
Differences that should matter to you are their command line flags and error/warning messages when something goes wrong.
One HUGE difference is that Borland focuses on Windows system only (at least when I was using it) and as such it has a lot of really nice custom Windows specific commands and libraries. GCC is sooo much more generic that it can take lot more work to do the same things that Borland can do w/o much fuss.
Borland is the compiler used in turbo c++. it works differently compared to GCC/MinGW. The header files must include
#include<iostream.h>
#include<conio.h>
and
using namespace std;
is not used in Borland like GCC.
In GCC, we began with
#include<iostream>
using namespace std;
in Borland, the namespace is automatically chosen and also you need to include the input-output conditions like #include<conio.h>
.
精彩评论