The Advanced Qt Programming book really -is- an advanced book, designed for people who are already very good at Qt programming. It isn't for learning Qt fundamentals. This book uses a couple of libraries developed by the author, and you must install and build them first before you can build any of the examples. It seems pretty clear that you haven't done that yet.

So find the project that contains the AQP namespace files, build that library first, then make sure the paths to the library's header and library files are correct in the makefiles for the examples. Once that first part is done, you should be able to build and run the examples.