[TICPP 2nd 习题][02][选择合适的编译器]
来源:互联网 发布:linux禁用usb存储设备 编辑:程序博客网 时间:2024/05/08 04:38
标题: [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++等相关环境都架设好。
- [TICPP 2nd 习题][02][选择合适的编译器]
- 把书读薄----TICPP(2)
- Day2(11.1):(2)选择合适的数据类型
- 选择合适的innodb_log_file_size
- 选择合适的协议
- 选择合适的数据类型
- 选择合适的数据类型
- 选择合适的目标
- 选择合适的JDBC驱动程序
- 选择合适的java脚本语言
- 选择合适的数据控件
- 如何选择合适的域名
- 选择合适的java脚本语言
- 如何选择合适的域名
- 选择合适的数据控件
- 选择合适的include机制
- 如何选择合适的VPN
- 选择合适的排序函数()
- cacm guest editorial on software patterns
- Object-Oriented Application Frameworks
- 质量管理手册
- java单元测试的两点注意事项
- 即将毕业的计机生@_@~~~~~~!!!
- [TICPP 2nd 习题][02][选择合适的编译器]
- 再见了,捷克!
- 2006 年6月23日
- 将ASP.NET用户控件转化为自定义控件
- ASP.NET 2.0开发指南笔记
- 初来乍到
- 成功的秘诀
- test
- 偷看ASP原码的6种方法