book cover
book cover

You Can Do It!

A Beginner's Introduction to Computer Programming

by Francis Glassborow with Roberta Allen

Home      Contact Us      News & Updates

Resources

Computer Programming Can be Fun

This page provides links that will allow an owner of the book 'You Can Do It' to find the originals of the software that is provided on the CD that comes with the book. That will allow you to update those software tools when new releases and bug fixes are made available by the various authors and maintainers of the software.

If you own the book you will have no need to use these links and go through the complications of upgrading via the Internet because the versions you have on the CD are perfectly adequate. Those who are interested in the fgw_lib support library that comes with the book or want to try a good simple combination of Integrated Development Environment (Quincy) and an excellent set of compiler tools for MS Windows (MinGW) can use the links to get the material. It won't be as easy to install as it would be from the book's CD but that is one of the benefits of buying the book.

Quincy

The latest version of Al Stevens' Quincy was released in January 2003 and is the version on the CD.

Alternative IDEs

I have been researching alternative IDEs for my next book. So far I have found two excellent ones which run on both Windows and Linux. Note that they are both a bit too much 'all singing, all dancing' tools for raw novices. However if you feel adventurous or are an experienced instructor looking for something for your students and are willing to help them with difficulties both are worth a look.

See the side bar for links to the home sites of MinGWStudio and jGrasp. The latter works with a selection of different compilers.

MinGW

There are various sources for updating MinGW but doing so is not trivial unless you are familiar with the necessary procedures. In addition the size of MinGW releases is substantial (in excess of ten megabytes) so a broadband connection is desirable. The CD with the book contains release 3.2.3. When a new release becomes available, and after I have checked what you will need to do to update to it I will place details of updating here.

The newer releases of MinGW (3.4) require that fgwlib.a be recompiled. The following version of fgwlib.a works with the MinGW 3.4 but it does NOT work with the version of MinGW from the CD accompanying the book.

fgwlib Library

Mike Brooks has reported two bugs in shape.cpp. The first is a minor bug in filled_polygon(). The second is a definite error in the implementation of the rotate_shape() function. The corrected source code is in the zip file of the support library below. And here is a compiled version for Quincy/MinGW.

Download a zip file with the latest compiled version of fgwlib.a for Quincy/MinGW (92Kb) version as shipped on the CD with the book. Unzip and replace the existing version of fgwlib.a in the fgw_headers sub-directory. This zip file also contains a corrected version of fgw_text.h which fixes a problem with some unqualified uses of std::cin.

Note that this version fixes the screen update bug that manifests on fast PCs.

For the benefit of those wanting to use the fgwlib library with other compilers for Microsoft Windows platforms the following zip file contains all the source code, together with a makefile. However, note that you will need the equivalent of libgdi32.a (which provides the low level code to handle WIN32 graphics) to complement the graphics component of fgwlib.

Download library_source.zip, a zip file of all the source for support library (112) Kbytes

The following zip file contains documentation for the fgwlib support library. This is also on the book's CD but is provided here for more experienced programmers who want to try it.

Download library_docs.zip an html file documenting the support library (20Kbytes).

When they become available I (Francis) will provide access to versions of fgwlib for other operating systems. I have had an implementation for Linux for several months but have not yet had the time to check it. If you have a special interest in trying fgw_lib based programs on a Linux machine please email me at the address provided on the contact page and I will send you an untested copy.

Tips from Martin Ross for using other tools

Installing "You Can Do It!" under Dev-C++

In short there are four steps:

1 Get the source code

Download the source code from the book's website. Put the .zip file into its own separate directory. When extracting select the "Use folder names" option in WinZip as some of the files will appear in a subdirectory called "library_source".

2 Amend playpen.cpp and minipng.cpp to include <cstdlib> instead of <stdlib.h>

Amend playpen.cpp (line 28) and minipng.cpp (line 10) so they include <cstdlib> instead of <stdlib.h>. It is safer to comment out the <stdlib.h> lines and to add new lines to include <cstdlib>. Both files are in the "library_source" subdirectory.

3 Rebuild fgwlib.a as a Static Library

Start a new project in Dev-C++. Select "Static Library" and call it "fgwlib". Add to the project all the header files in the base directory where you unpacked the source code. From the "library_source" sub-directory add all the *.cpp files that match one of the headers you have already included. I didn't include any other .h or .cpp files. My project includes:

colournames.h
fgw_texh.h
flood_fill.h and .cpp
keyboard.h
line_drawing.h and .cpp
minipng.h and .cpp
mouse.h
playpen.h and .cpp
point2d.h and .cpp
point2dx.h and .cpp
shape.h and .cpp

Francis: these are not enough because the project also needs the C files (inlcuded in the source code zip, that provide compression.

Set Project -> Project Options -> Directories to list both the directory you unpacked to and the "library_source" sub-directory.

Click on the Compile button to create a new fgwlib.a

4 Include both fgwlib.a and libgdi32.a in all relevant projects.

For each new project that will use stuff from the book you will need to include fgwlib.a and libgdi32.a. Select Project -> Project Options -> Parameters. At the lower right, under the box marked "Linker" is a button marked "Add Library or Object". Click this and select your newly created fgwlib.a. When fgwlib.a has been added, do the same to add libgdi32.a. I used the copy that came with Dev-C++ which I found in Dev-Cpp\lib. The book emphasises that fgwlib.a should come before libgdi32.a so that is the order I included them.

If you want to you can set this up as a Project Template so you don't have to add these two files to each project, just pick the right template.

For further advice on Dev-C++ try the Dev-C++ discussion Forums at Dev-C++ discussion


These steps worked for me on Dev-C++ 4.9.9.0. The playpen works as it should, but I still have some problems with minipng. I have not done a great deal of experimentation so I cannot promise that these steps are minimal; all I can say is that they worked.

Francis: Note that the source code now includes a make file, so readers can recompile the library for a different Windows compiler. I will shortly provide a similar facility for Linux users.]

The "#include <stdlib.h>" line in miniPNG.cpp does not seem to cause the same problems for me, perhaps because I have not yet tried saving and restoring PNG images, while I do use the playpen a lot.


Your book asks for readers to send in programs. Is that limited to beginners, or are those of us who have been programming for a while in different languages (Algol-60 anyone?) also welcome to send in our efforts?

Francis: Anyone can send in programs and program exercises.

© F. Glassborow & R. Allen 2003