I have Qt4.3 installed on my at-work machine, and it's used for our main software development. Our builds run fine.

Today, wanting to learn more about Qt4, I'm building the very simple "hello world" demo app in Chap. 1 of the Blanchette-Summerfield book. It looks the same as in other books and online tutorials, as far as I can see, except mine is named 'hey' instead of 'hello' (too busy to type longwinded 5-letter names :P).

But in my case this won't build. I ran 'qmake -project' and have the resulting .pro file in a text editor. Then I run qmake (no args) then make. Sometimes I get this error:

bash> make
g++ -c -pipe -Wall -W -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DQT_NO_DEBUG -DQT_SHARED -DQT_THREAD_SUPPORT -I/usr/lib64/qt-3.3/mkspecs/default -I. -I. -I/usr/lib64/qt-3.3/include -o hey.o hey.cpp
hey.cpp:4:24: error: QApplication: No such file or directory
hey.cpp:5:18: error: QLabel: No such file or directory
... subsequent errors due to no finding Qt's include files...

but sometimes I get this error:

bash> make
g++ -o hey hey.o -L/usr/lib64/qt-3.3/lib -lqt-mt -lXext -lX11 -lm
hey.o: In function `main':
/users/dwilson/play/qtblanchette/hey/hey.cpp:10: undefined reference to `QApplication::QApplication(int&, char**, int)'
hey.o: In function `QString':
/usr/include/QtCore/qstring.h:376: undefined reference to `QString::fromAscii_helper(char const*, int)'
... several more undef refs ...

What bonehead beginner mistake am I making?