With the consent of Dr. Bjarne Stroustrup, founder of C + +, I have translated this article and posted it here for the reference of the friend who chose the compiler. Welcome reprint, Reprint please indicate the source.
English version of the original in http://www.research.att.com/~bs/compilers.html
I (Bjarne Stroustrup) are often asked to advise the C + + compiler, but I don't recommend it because it looks like it's on the side of a commercial war. Moreover, I do not know every C + + compiler, just know C + + compiler a dime. In general, I use a half dozen (6) compilers, but at best it's just a cosmetic thing.
I suggest that people carefully consider how consistent it is with the standard when using a compiler. If possible, avoid using any compilers that do not conform to ISO standards or do not support an implementation of a standard library. The latest versions of all major C + + compiler vendors are doing well.
If you're a novice and don't know how to identify a compiler, try compiling the following program:
#include<iostream>
#include<string>
using namespace std;
int main()
{
string s;
cout << "Please enter your first name followed by a newline\n";
cin >> s;
cout << "Hello, " << s << '\n';
return 0; // 该返回语句可以不要
}
If a compiler cannot handle such a simple program, it is not suitable for learning standard C + +. (If you cut and paste the above code, be careful of the "less than" #include instructions).
Although these details are already obsolete, here is a lengthy article on the issue of consistency and the compiler status page for boost.org '. Consistency is just one metric of compiler quality (producing code quality, error information, compilation speed, integration with development tools, support, backward compatibility, and all other metrics), but consistency is important. Using the language extension and non-standard features of a vendor limits your code portability and prevents you from choosing a new vendor's product.
Most compilers are embedded within the framework and libraries of software development tools. These frameworks, environments, and libraries may be useful to you, but remember that using them will lock you into a single vendor, and some applications have serious operational performance problems.
When looking for C + + on the Internet, you will find a lot of information "hidden" under their respective products. In fact, I use Google.com to find C + + compilers more convenient than directly contacting C + + compiler vendors. In this case, ignoring the market logo, I list many providers of C + + compilers.
Some compilers can be downloaded for free (try to see their conditions/licenses before attempting a commercial application):
· Apple C + +. There are also on the OS X development Tools CD.
Http://developer.apple.com/tools/macosxtools.html
· Bloodshed dev-c++. An IDE based on GCC (MINGW).
Http://www.bloodshed.net/devcpp.html
· Borland C + +
Http://www.borland.com/downloads/download_cbuilder.html
· Cygwin (GNU C + +)
http://www.cygwin.com/
· Digital Mars C + +
http://www.digitalmars.com/
· MinGW-"Minimalist GNU for Windows". Another GCC for Windows version contains a free (non-GPL) W32api.
http://www.mingw.org/
· DJ Delorie ' s C + + development system for Dos/windows (GNU C + +)
Http://www.delorie.com/djgpp
· GNU CC Source
Http://www.gnu.org/software/gcc/gcc.html
· IBM C + + is used for IBM power, System Z, Bluegene, and Cell.
Http://www-949.ibm.com/software/rational/cafe/community/ccpp
· Intel C + + for Linux
Http://www.intel.com/software/products/compilers/clin/noncom.htm
· The LLVM Compiler infrastructure (based on GCC).
http://llvm.cs.uiuc.edu/
· Microsoft Visual C + + 2008 Express Edition.
Http://www.microsoft.com/express/vc