There are many reasons why the application might not build. The first thing to check is that the compiler is properly installed. Second, entering the name of the application that compiles the program on the command line will tell you whether the software is actually available.
The code itself, if it is copied correctly from the book or taken from the companion Web site, should compile with no errors as is. It might not link, however, if linking is a separate application that also need to be installed and configured.