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

标题: [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++等相关环境都架设好。

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值