Hmm seems that there is some confusion here...
First of, lets forget about any possible errors in your code, cover them if you get a compiler error which indicates that there is a problem in your source code (notice, no reference to your source file in the error message generated, ie your source file will be something like helloworld.cpp.)
Next, this is the build line that qmake generated automatically for you from your .pro file:
g++ -o helloworld -L/usr/lib/qt-3.1/lib -L/usr/X11R6/lib -lqt-mt -lXext -lX11 -lm
Ok, now this is what it should look like:
g++ -o helloworld helloworld.cpp
-L/usr/lib/qt-3.1/lib -L/usr/X11R6/lib -lqt-mt -lXext -lX11 -lm
If you run the live above, it will most probably compile your code (since now it knows what the source file is)
So I guess that in your .pro file there is a mistake or missing option, one which specifies which .cpp files are to be included in your build.
Ok, so I quickly googled for 'qmake .pro' and the fourth hit down will give you the answer
I think the line :
SOURCES = helloworld.cpp
should be added to your .pro
And if you have a helloworld.h header also add
HEADERS = helloworld.h
That line is for dependancy checking, used to determine if it needs to compile this unit (ie if either source or header is changed). This is not used to build the code, instead it is used by make to fire a rule cause it to rebuild your code.
I dont not have experience with qmake, so I could be wrong, but that is how it looks to me.