Using CodeBlocks 10.05 – Part 1

The content of C++ All-In-One Desk Reference For Dummies is currently designed around CodeBlocks 8.02, which is actually the next to the last version released (it’s not that oldthere doesn’t appear to be a version 9.0 product to download). Many of you have noticed that CodeBlocks 10.05 has been released recently and wonder if you can use it for the book. Of course, that’s a loaded question answered by two simple words, “It depends…” What it mostly depends upon is your skill as a developer and as a reader. If you’re an absolute novice, I highly recommend that you continue using the 8.02 release that you can obtain using the procedure found in my Getting CodeBlocks to Work post. If you’re working with a Mac, please use the procedure found in my CodeBlocks on a Macintosh post instead.

If you’ve worked with other languages and have more than a passing familiarity with your computer, you can probably use CodeBlocks 10.05 with this book. You can obtain the latest version at http://www.codeblocks.org/downloads/26. Make sure you download the proper version for your platform. For the PC, that means downloading the codeblocks-10.05mingw-setup.exe file from the site and installing it on your system. Macintosh users will require the codeblocks-10.05-p1-mac.dmg file. In addition, you’ll need to download the Xcode tools from Apple as described in the CodeBlocks on a Macintosh – Part 2 post.

There are certain differences you’ll notice immediately. For one thing, the screenshots in the book won’t precisely match what you see on screen. The next several posts for this book will examine the new CodeBlocks 10.05 and how it differs from its predecessor. These posts won’t replace a complete book, so you can’t assume that this is any sort of update for C++ All-in-One Desk Reference for Dummiesview them more as heads up articles on what you should expect.

In order to gather this material, I decided to perform a default installation of CodeBlocks 10.05. So, if you’ve decided to perform a full install or add some special features, you may still see some differences on your screen than you see in these posts. The best advice I can offer is to perform the default install and then work up to those special features later.

One of the first differences you’ll notice with the 10.05 installation is that the installer makes it obvious that it either did or didn’t detect your favorite compiler. This was a problem with the 8.02 version and I’ve had more than a few e-mails about it. Here’s the detection screen you should see after you complete the installation.

CodeBlocks10_05Part1_1

Notice that it has detected the GNU GCC compiler. This is the compiler you need for the book. If you don’t see this detection notice, it means that something has gone wrong with the installation. This is especially true on the Mac where you need to install the Xcode developer tools before you attempt the CodeBlocks installation.

The process for creating a new project is precisely the same as the 8.02 release. You still choose File > New > Project. However, you’ll notice that CodeBlocks 10.05 provides a significant number of new templates as shown here.

CodeBlocks10_05Part1_2

You won’t find any of these new templates in C++ All-in-One Desk Reference for Dummies, but I’d love to hear about any template that you consider essential for the success of a book update. Creating a console project appears to work the same as described in the book. So, you should be able to go through these early chapters without any problem. Please do let me know about any differences you see so that I can discuss them in another post.

One big difference that I noted while working with the book’s source code is that if you try to open a project by double clicking the .CBP file (such as SayHello.cbp for the first project in the book), you’ll get an error message saying that there is already an instance running and that you can’t open another instance of CodeBlocks. If you see this message, simply close the current copy of CodeBlocks and try again. As an alternative, you can use the File > Open command in CodeBlocks to open the second project.

If you simply want to see the example run, choose Build > Run to start it. You can also press Ctrl+F10 or click Run on the Compiler toolbar to get the same result. The output will look similar to the screenshots shown in the book. The debugger does work a little differently and I intend to discuss it in a future post.

So far I haven’t found any examples in the book that won’t run with the new compiler. However, I haven’t fully tested all of the examples yet, so you might find something that doesn’t work as advertised. If you find any examples that fail to work, please be sure to let me know at John@JohnMuellerBooks.com. Remember that the screenshots could look different than those you see in the book and there isn’t much I can do to fix this problem at the moment.

 

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.