[TICPP 2nd 习题][02][选择合适的编译器]

原创 2006年06月23日 00:01:00

标题: [TICPP 2nd 习题][02][选择合适的编译器]
作者: Jack Yang
日期: 2006/06/22
状态: 未完

开始做习题之前,必须作的一件事情就是选择一个合适的编译器,选择的标准就是这个编译器必须尽可能全的支持C++的ISO标准。

下面是Bruce Eckel对W32编译器所做的评价
http://mindview.net/Books/TICPP/ThinkingInCPP2e.html#Compilers

Win32 Compilers

The code in these books has been written to compile under a fully- compliant ISO C++ (Standard C++) compiler. A command-line version of the Borland C++ compiler is available as a free download. This compiler isn't fully compliant with all standard C++ features; you can find the files that it won't compile (which are excluded from the makefiles) in the file CompilerData.txt which comes with the distributions. While old Visual C++ is not so good, the new Microsoft C++ for .NET (payware) is very good. The free Digital Mars compiler is also very good.

The open-source GCC compiler (g++) is one of the most compliant C++ compilers available. This compiles and runs very well under Linux, but you can also run it under Win32 using Cygwin at http://www.cygwin.com/, which is gcc + the bash shell and gnu utilities ported to Windows. If you've ever used Unix, Cygwin will give you back what you missed -- it's truly remarkable. You can actually compile and run virtually any non-gui Unix application under Cygwin. If you use make, it solves all the problems of trying to use make under Win32.

To learn more about installing Cygwin and GCC on your Win32 machine, see here.

A note about pre-.NET Visual C++. I periodically receive messages saying that Visual C++ will not compile many of the programs in the book. Let me attempt to be diplomatic here. Before .NET, Microsoft stated that what they are creating is "a Windows compiler." Their interest was in creating a compiler that makes Windows programs, and not one that is compliant to the C++ Standard. As a result, the Standard C++ features in pre-.NET VC++ increased at a relative crawl, and you should not expect that compiler to compile many of the programs in the book. The complete listing of files that will not compile can be found in the file CompilerData.txt in both volumes.

If you find a problem with a program and pre-.NET VC++, it is extremely likely that it is a deficiency in VC++ and not in the code listing. A Microsoft makefile is included that will successfully compile all possible programs in the book.

So the upshot is this: if you want to use Microsoft C++, choose Managed C++ for .NET.

Here is a file msfix.h which was created by Chuck Allison to fix the return from main warning and the for loop namespace scope issues in the Visual C++ compiler. [ Click here to download ]

 从中可以看出Bruce Eckel认为不错的编译器有
1.  MS为.NET平台开发的新版C++编译器
2.  Digital Mars 编译器(free)
3.  开源的GCC编译器(g++)

权衡再三,准备使用g++,并且配合Cygwin.那么接下来的工作,就是把Cygwin和g++等相关环境都架设好。

 

编程珠玑【学习笔记】:习题 编程珠玑2nd 3.7 第五题

//编程珠玑2nd 3.7 第5题 由于我的能力有限,可能会出现一些愚蠢的错误,若您能提出宝贵意见,我将不胜感激! //欢迎您与我联系!【我的邮箱】:lxw0109@gmail.com /...

Note On <Programming Entity Framework 2nd Edition> -02: How to Use SqlExpress Profiler 2.0

Chapter3: Querying Entity Data Models The example code of Entity SQL in this chapter at page 57 does...

CF 593 A 2Char(选择合适的枚举方式)

题目链接: CF 593 A 2Char 题意: 给出n个只含小写英文字母的字符串,选择若干字符串,拼成一个最多只含两种字母的最长的字符串,输出最长字符串长度。 分析: 我是选择枚举每个最多...
  • Ramay7
  • Ramay7
  • 2016年03月12日 17:47
  • 179

STARC_TLMGuide_2nd(2009Mar02)_e.pdf

  • 2010年07月21日 16:33
  • 2.19MB
  • 下载

Day2(11.1):(2)选择合适的数据类型

-- 2 **************************************************** -- 选择合适的数据类型 -- 2.1 --------------------...

Spring In Action 2nd Edition part02 (完)

  • 2008年11月03日 12:33
  • 2.63MB
  • 下载
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:[TICPP 2nd 习题][02][选择合适的编译器]
举报原因:
原因补充:

(最多只允许输入30个字)