Using CodeBlocks 10.05 – Part 4

The testing of my book,  C++ All-In-One Desk Reference For Dummies, for use with CodeBlocks 10.05 continues. I introduced this new version in Using CodeBlocks 10.05 – Part 1, where I discussed the general look of the new version.This post concerns Book IV Chapter 2 (found in \Author\BookIV\Chapter02).

On page 431 you see the explanation of the LValueAndRValue example. This example is supposed to fail in a specific way and it still does just as the book specifies, but with a different error message. I’ve pointed out a few other error message changes in other posts (you can see the entire list of posts for this book in the Category Archive for C++ All-in-One for Dummies). In this case, the error message has changed to:


error: lvalue required as left operand of assignment

The change isn’t a big one, but some readers could find it confusing. A few readers have asked how you’d fix the example. Well, you’d make DontKnow() to look like ChangeMe() as shown here:

int &DontKnow()
    return uggle;

The StaticCast example shown on page 437 is designed to show a warning message in its final form. This warning message is the same in CodeBlocks 10.05:


warning: unused variable ‘f’

Some readers are confused about how to get the error message described in the book. It may have been best in this case to provide two examples on the disk. However, you can easily change this example to fail as described on page 437. Simply change line 6 of the code to look like this:

class AnotherType {}; //: public FinalType {};

However, when you try to compile the example, you’ll find that CodeBlocks 10.05 again changes the message slightly. In this case, you’ll see:


error: invalid static_cast from type ‘AnotherType*’ to type ‘FinalType*’

The differences are small in this chapter, but worth noting. CodeBlocks 10.05 attempts to make the error messages easier to read. If you see small differences in the error messages and you’re using CodeBlocks 10.05, there is probably nothing to worry about. Please do contact me if you have major concerns about a CodeBlocks 10.05 different at


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 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 is also setting up a website at Feel free to take a look and make suggestions on how he can improve it.