http://www.bdsoft.com/tools/stlfilt.html
这个工具不错,可以对STL出错信息进行过滤处理,让信息容易看懂!
Linux 用法:
1. 下载 gstlfilt.tar
2. gfilt g++ test.cpp
...
STLFilt:
An STL Error Message Decryptor for C++
Open Source Freeware by Leor Zolman, Supporting:
STLFilt-ing is now selectable on both the Comeau and Dinkumware online compiler pages!
Now compatible with ALL Visual Studio 200x IDEs !!!
Participate in the STLFilt Forum on the new BD Software Message Board!
STLFilt simplifies and/or reformats long-winded C++ error and warning messages, with a focus on STL-related diagnostics (and for MSVC 6, it fully eliminates C4786 warnings and their detritus). The result renders many of even the most cryptic diagnostics comprehensible. Here is the rationale.
The active ingredient in each distribution is a Perl script, so you'll need a Perl interpreter installed; ActivePerl works best, and it's free.
The downloads follow, organized by platform:
- Microsoft Visual C++ 6/7/8/9: stlfilt.zip (484K, updated 10/22/2007). Includes the "Proxy" CL compiler, multi-platform-aware STLTask tray-resident control utility (screen shot), and support for long type-name wrapping (see the gcc section below). Demo runs: VC6 VC7+ long type-names . Supports both the IDE and command line environments, in conjunction with any or all of the following C++ libraries:
- Native MSVC 6
- Native MSVC 7.x, 8.x, 9.x (IDE-based Decryption within VS2005/2008 now WORKS. See README-VC.txt)
- STLport 4.x
- Dinkum 3.08
- Dinkum Unabridged Library
- gcc 2.9x/3.x/4.x (tested under MinGW up to 4.1.1, and under TDM gcc 4.2.2) For Windows: gstlfilt.zip (409K, updated 6/16/2008). For Unix, Linux, etc.: gstlfilt.tar (180K, updated 2/3/2008). Demo Run. Supports intelligent wrapping of very long type-names (such as those that arise in template metaprogramming applications) with a set of customizable rules suggested by David Abrahams (Demo). The Windows-based gcc Decryptor distribution now includes a Proxy c++ compiler (provides Dev-C++ compatibility, and also makes up for the Win9X command prompt's lack of stderr redirection) and multi-platform-aware STLTask utility. [For a nice, self-installing Windows-based MinGW gcc 3.x distribution, click here and download the self-installer (named MinGW-x.x.x-x.exe in the Current/MinGW section). You may also want to read these notes if you use extended (hash-based and slist) containers].
- Comeau C++: For Windows: comofilt.zip (35K, updated 11/28/2003). For Unix, Linux, etc.: comofilt.tar (110K, updated 11/28/2003). Demo Run. The Comeau Decryptor now supports both the libcomo and Dinkum libraries. Many thanks to Greg Comeau for building intrinsic command-line support for STLFilt into his compiler, and for his towering support of all aspects of Comeau C++ so far out of proportion to the package's microscopic selling price!
- Intel C++ 7/8: For Windows (now with Proxy ICL and STLTask utilities): intelfilt.zip (389K, updated 9/08/2004). For Unix, Linux, etc.: intelfilt.tar (120K, updated 11/28/2003). Demo Run.
- EDG C++ "Demo" Front End: For Windows: edgfilt.zip (32K, updated 11/25/2003). For Unix, Linux, etc.: edgfilt.tar (110K, updated 11/25/2003). If you're using Comeau or Intel C++, use one of those platform-specific distributions above. This version for the EDG demo compiler has only been tested with the Dinkum library.
- Metrowerks CodeWarrior Pro 7/8: For Windows: cwfilt.zip (29K, updated 11/24/2003). For OS X, Unix, Linux, etc.: cwfilt.tar (100K, updated 11/24/2003). Demo Run.
- Borland C++ 5.5.1 and C++Builder: Supports Command-Line Tools only: bccfilt.zip (28K, updated 11/22/2003). Demo Run. Tested under both C++Builder 6 and C++Builder X (Trial versions).
- Digital Mars C++: Supports command-line tools (using STLport only, so far): For Windows: dmcfilt.zip (31K, updated 03/20/2004). Demo Run. For Unix/Linux, etc.: dmcfilt.tar (100K, updated 03/20/2004).
Below is component-specific version information. Clicking on a version number displays the reverse-chronological change log for the associated component:
Component | Version | Last |
STLFilt.pl | 10/16/2007 | |
CL.cpp | 10/16/2007 | |
STLTask | 9/8/2004 | |
comofilt.pl | 11/28/2003 | |
gSTLFilt.pl | 1/28/2008 | |
C++.cpp | 06/16/2008 | |
cwSTLFilt.pl | 11/24/2003 | |
bSTLFilt.pl | 11/22/2003 | |
edgfilt.pl | 11/25/2003 | |
intelfilt.pl | 11/28/2003 | |
dmSTLFilt.pl | 3/20/2004 |
For convenience, here is a cross-platform command line option overview. Full documentation on script options is present in the Perl source -- examine each script you use up to the comment reading "End of user-configurable settings" to see the full set of available customizable features specific to that version.
STLFilt in Print
Leor Zolman's C/C++ Users Journal article, An STL Error Message Decryptor for Visual C++, appears in the July, 2001 issue. It is available for viewing online.
In their new book C++ Template Metaprogramming, David Abrahams and Aleksey Gurtovoy descrbie the use of STLFilt to help with formatting and re-ordering of metaprogramming errors. See section 8.2 ("Using Tools for Diagnostic Analysis"), pages 156-158.
Bruce Eckel and Chuck Allison mention STLFilt on page 320 of Thinking in C++ Volume Two: Practical Programming (entire book downloadable for free!)
Nicolai Josuttis and Daveed Vandevoorde cite STLFilt in section 6.6.1 of their book C++ Templates (2nd printing and up).
Scott Meyers mentions STLFilt in Item #49 of Effective STL. Note: The official download page for Effective STL's source code archive is here.
Related Tools
For a rules-based, generally configurable text filtering tool with many parallels to STLFilt (including pre-configured error decoding scripts for several C++ compilers), but implemented using Boost's Regex++ package, check out Daniel Frey's TextFilt.
Need a simple, handy way to stuff arbitrary values into a new STL container in a single statement? Check out BD Software's new, free, STL Container Initialization Library.
Giving and Getting Help
STLFilt is provided as open source Freeware in the interest of promoting the learning and use of C++. If you find this software useful, and would like a way to return the favor other than monetarily, then please note: STLFilt's author, Leor Zolman, makes a living leading hands-on, on-site training in C/C++, Java, Perl and Unix. Any help in bringing BD Software's course offerings to the attention of the folks in your training department would be sincerely appreciated.
Even though STLFilt is Freeware, you are entitled to support (believe it or not). When the author first reads about bugs on newsgroups and message boards, he has trouble understanding why no one bothered to tell him about them first. Please report bugs!!! Pretty please with sugar on top! In fact, any type of feedback is welcome. And please visit / participate in the STLFilt Message Board.
Still have no clue what an error message is trying to say, even after applying STLFilt? You can find me and other folks willing to help with those and just about all other kinds of C++-related questions on the Usenet newsgroup alt.comp.lang.learn.c-c++. Drop by and feel free to post your questions!
Please link to this page to raise awareness of STLFilt. Kudos to Comeau Computing, Dinkumware and Metrowerks for helping to spread the word via their web sites.
STLFilt is Freeware: open source, totally free, no strings attached...if you find the software useful, however, please tell someone about BD Software's on-site training courses.
Would you like one of these cool bumper stickers absolutely free? Just send a SASE (address here) and I'll send you some.
Home | Courses | Tools | Resources
Clients | Successes | Contact | Site Map | Links | About Us
All text and images on this website are Copyright © 2001-2003 BD Software.
All rights reserved.