The current version is ChiLib version 1.05. This version includes support for Unix/Linux with g++ and limited support for X11.
Look at the time stamps of the files. The time (1.00, 1.01, 1.02 etc.) gives the version number, the date the release date of the version.
Actually, this information was supposed to be in the book but got axed in the last minute because the book was already getting longer than originally planned. You can now find the documentation in the CHILIB.TXT file on the disk in the back of the book. Even better, thanks to the excellent work of Tim Balls at Leeds Metropolitan University, the documentation is now available in HTML format.
Make sure that you define the appropriate compiler flags:
|Microsoft >= 4.0||CHI_MC40|
|Borland >= 5.0||CHI_BC50|
|Symantec >= 7.0||CHI_SC70|
|Watcom >= 10.0||CHI_WC10|
Get version 1.04 or above from this web page. Be sure to #define CHI_WIN32.
Borland 4.5 dies with an internal error in some perfectly legal constructs in some Chilib files. In ChiLib 1.01 and above, you can #define CHI_BC45 to switch to a workaround. In ChiLib 1.00, you must do this manually. Two files are affected, chishape.cpp and gedfrmwk.cpp. Instead of writing
fig.append(new Chi_Rectangle(Chi_Point(0.1, 2.2), Chi_Point(1.9, 3.8))); fig.append(new Chi_FilledRect(Chi_Point(0.2, 4.1), Chi_Point(1.8, 5.9), Chi_GraphicsContext::XDIAG_BRUSH)); fig.append(new Chi_Segment(Chi_Point(0.1, 6.2), Chi_Point(1.9, 7.8)));in chishape.cpp, put the points into separate variables
Chi_Point p2 = Chi_Point(1.9, 3.8); fig.append(new Chi_Rectangle(Chi_Point(0.1, 2.2), p2)); p2 = Chi_Point(1.8, 5.9); fig.append(new Chi_FilledRect(Chi_Point(0.2, 4.1), p2, Chi_GraphicsContext::XDIAG_BRUSH)); p2 = Chi_Point(1.9, 7.8); fig.append(new Chi_Segment(Chi_Point(0.1, 6.2), p2));The same is necessary in gedfrmwk.cpp. Replace
_button_rect = Chi_Rectangle(Chi_Point(0, 0), Chi_Point(1, r.ybottom()));with
Chi_Point p2 = Chi_Point(1, r.ybottom()); _button_rect = Chi_Rectangle(Chi_Point(0, 0), p2);
No, Chilib does not reprogram the keyboard controller. This is a problem with precompiled headers. The Borland precompiled header parser crashes when it encounters constructs in header files that differ from those found in the plain vanilla system headers. Apparently the mdgen generated Chilib headers make the parser throw a fit. Until Borland engineers a parser that works on all headers, instead of hacking one that works on those they know about, turn off precompiled headers.
No, you didn't write more than 64K worth of comment text. Try switching to large memory model. That works in 99% of the cases. By the way, the TEXT segment is the code segment.
What if you are one of the few unlucky ones who gets a _TEXT overflow even in large memory model? The reason is template instantiation. Borland and Symantec generate all member functions of all templates in your code, and if you have lots of different templates in one source file (e.g. arrays of ten or more different types) you can get that overflow. Remedy 1: Switch to 32-bit mode. 2. Use manual template instantiation.
For graphics programs, you must define one of CHI_BGI, CHI_WIN, etc. With ChiLib 1.0, your graphics program will crash if none of these is defined. With ChiLib 1.01 and up, it won't compile.
If another part of your program corrupts the internal data strucures of the reference counted strings, this may happen. In all known cases, this was the consequence of buggy user code, not a bug in ChiLib.
You have a compiler that does not correctly deal with explicit destructors in templates, such as Microsoft 2.0 or 2.1 or Borland 3.0. Remedy: Use Chi_NumArray or Chi_PtrArray. For arrays of classes, add a do-nothing destructor to your class.
Thanks to Professor Hamilton Richards at the University of Texas at Austin (email@example.com) for a set of files that implement a graphics context class on the Mac and that add a few functions missing from the Metrowerks compiler. The files are zipped together as CHI_MAC.ZIP.
The file MOODAPP2.RTF contains the coding guidelines in RTF format. You can modify this file for use in any class that uses the Mastering Object-Oriented Design in C++ book as a required text. Any other use, for example for corporate or university style guides, requires written permission from the copyright holder, and payment of a fee.
Back to Cay Horstmann's home page.