Using CodeBlocks 10.05 – Part 8

This should be the next to the last post in this long running series. In the previous post, Using CodeBlocks 10.05 – Part 7, I was able to cover up to the end of Book V of C++ All-In-One Desk Reference For Dummies. This post begins with Book VI Chapter 1. I’m hoping to wrap up the coding differences for CodeBlocks 10.05 in the next post. You can find a complete list of these posts in the C++ All-in-One for Dummies category archive.

On page 638, you’ll find an example of the Functors category of the standard library. Likewise, on page 649 you find an example for working with temporary buffers. Neither example will compile in CodeBlocks 10.05 until you add another #include:

#include <algorithm>

On page 640, you’ll find a hash example. It compiles just fine, but you’ll receive this rather ominous sounding warning:


#warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated.

It’s safe to ignore the warning for this edition of the book. In fact, you may see a number of these warningsall of which are safe to ignore for the time being. The example will run as before. The purpose of the warning it to tell you that a code update is necessary to keep pace with changes to the C++ libraries. I’ll be updating the code to use newer headers in the next edition of the book.

On page 641, you’ll find the hash map example, which won’t compile in CodeBlocks 10.05. This example requires the addition of another #include statement:

#include <string.h>

On page 647, you’ll find an example for using the random number generator. This example requires that you add the following two #include statements:

#include <time.h>
#include <stdlib.h>

On page 663, you’ll find an example for performing template specialization. You’ll need to add the following #include for this example:

#include <limits>

I tried the Boost examples in Book VI Chapters 3 and 4 using the latest version as of this writing (version 1.47.0). It appears to work fine with CodeBlocks 10.05 and the source code in the book. However, I’d like to hear about any problems that anyone has encountered using it.

If you encounter any other problems with Book VI, please be sure to let me know. In the next post I’ll start
with Book VII Chapter 1. In the meantime, keep those e-mails coming to