I just had the same problem. Solution is:
Go to Project -> Properties -> Configuration Properties -> C/C++ -> Preprocessor
Add QT_GUI_LIB to Preprocessor Definitions.
(taken from http://truth2.wordpress.com/2010/09/...compile-error/)