Source Code Placement

I always recommend that you download the source code for my books. The Verifying Your Hand Typed Code post discusses some of the issues that readers encounter when typing code by hand. However, I also understand that many people learn best when they type the code by hand and that’s the point of getting my books—to learn something really interesting (see my principles for creating book source code in the Handling Source Code in Books post). Even if you do need to type the source code in order to learn, having the downloadable source code handy will help you locate errors in your code with greater ease. I won’t usually have time to debug your hand typed code for you.

Depending on your platform, you might encounter a situation the IDE chooses an unfortunate place to put the source code you want to save. For example, on a Windows system it might choose the C:\Program Files folder (or a subdirectory) to the store the file. Microsoft wants to make your computing experience safer, so you don’t actually have rights to this folder for storing your data file. As a result, the IDE will stubbornly refuse the save the files in that folder. Likewise, some IDEs have a problem with folder names that have spaces in them. For example, your C:\Users\<Your Name>\My Documents folder might seem like the perfect place to store your source code files, but the spaces in the path will cause problems for the IDE and it will claim that it can’t find the file, even if it manages to successfully save the file.

My recommendation for fixing these, and other source code placement problems, is to create a folder that you can access and have full rights to work with to store your source code. My books usually make a recommendation for the source code file path, but you can use any path you want. The point is to create a path that’s:

  • Easy to access
  • Allows full rights
  • Lacks spaces in any of the path name elements

As long as you follow these rules, you likely won’t experience problems with your choice of source code location. If you do experience source code placement problems when working with my books, please be sure to let me know at John@JohnMuellerBooks.com.

 

Using Boost 1.48.0 with CodeBlocks 10.05

Whenever you work with the material in C++ All-In-One Desk Reference For Dummies it’s always best to use the version of the software that the book is written to use. For the current version of the book, that means using CodeBlocks 8.02 and Boost 1.39.0. However, some readers really do want to use the most current version of the software and I can understand why they’d want to do so. That’s why I wrote a series of posts discussing the use of CodeBlocks 10.05:

 

 

Part 8 of this series of posts says that I’ve tested the book’s code with a combination of CodeBlocks 10.05 and Boost 1.47.0. Since that time, the makers of Boost have come out with another version of the product and a few readers have questioned me about it. I’ve verified that the compiler does in fact work with Boost 1.48.0 as well. So, you can use CodeBlocks 10.05 and Boost 1.48.0 together.

That said, some of the procedures found in the book for performing tasks such as building the tools are unlikely to work without modification. For example, on page 679 I tell you how to build Boost Jam. This tool no longer exists in 1.48.0, so naturally that directory is missing and the procedure won’t work. If you plan to use Boost 1.48.0, you’ll need to modify the procedures in the book to match your setup. I’ll rewrite these procedures to work with the latest version of the software during the next book update.

There is one important change you need to know about in order to successfully build the applications using Boost 1.48.0. Look on page 693 and you see a procedure for adding the Boost directory to the search directories list. You must change the directory to match the installation directory for Boost 1.48.0. The book assumes you’re using Boost 1.39.0 and uses that directory in the procedure. Other than this change, the example should work just fine.

If anyone does run across a problem using Boost 1.48.0, I’d love to know about it. Please contact me at John@JohnMuellerBooks.com with details about the problem you’re having and I’ll do my best to solve it.