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 John@JohnMuellerBooks.com.

Author: John

John Mueller is a freelance author and technical editor. He has writing in his blood, having produced 99 books and over 600 articles to date. The topics range from networking to artificial intelligence and from database management to heads-down programming. Some of his current books include a Web security book, discussions of how to manage big data using data science, a Windows command -line reference, and a book that shows how to build your own custom PC. His technical editing skills have helped over more than 67 authors refine the content of their manuscripts. John has provided technical editing services to both Data Based Advisor and Coast Compute magazines. He has also contributed articles to magazines such as Software Quality Connection, DevSource, InformIT, SQL Server Professional, Visual C++ Developer, Hard Core Visual Basic, asp.netPRO, Software Test and Performance, and Visual Basic Developer. Be sure to read John’s blog at http://blog.johnmuellerbooks.com/. When John isn’t working at the computer, you can find him outside in the garden, cutting wood, or generally enjoying nature. John also likes making wine and knitting. When not occupied with anything else, he makes glycerin soap and candles, which comes in handy for gift baskets. You can reach John on the Internet at John@JohnMuellerBooks.com. John is also setting up a website at http://www.johnmuellerbooks.com/. Feel free to take a look and make suggestions on how he can improve it.