Problems with qmake

I've been following a tutorial for qt programming. I'm not new to C/C++ but am to graphical programming. The tutorial provides an example program for each lesson and gives the following two commands to compile it:

Code:
qmake -project
qmake

The first time I ran it, I got this error:

Code:
[kenshi@bahamut ..ing/c++/qt/tut1]% qmake -project
[kenshi@bahamut ..ing/c++/qt/tut1]% qmake         
QMAKESPEC has not been set, so configuration cannot be deduced.
Error processing project file: /home/kenshi/programming/c++/qt/tut1/tut1.pro

Somewhere I found that QMAKESPEC should be set to /usr/local/share/qt4/mkspecs/freebsd-g++. After setting it, I get the following error:

Code:
[kenshi@bahamut ..ing/c++/qt/tut1]% qmake -project
[kenshi@bahamut ..ing/c++/qt/tut1]% qmake         
Project LOAD(): Feature qt_config cannot be found.

I can't find anything on this error and qt and qmake are completely new to me. I could really use some help getting this going.
 
Well I'm getting a bit closer. After typing the above, qmake no longer gives any errors, but make says the following:

Code:
main.cpp:1:24: error: QApplication: No such file or directory
main.cpp:2:23: error: QPushButton: No such file or directory

They were both included in the program. In case you need to see the program, it's near the top of this page.
 
Just in case someone stumbles upon this. If you are using FreeBSD 10 and installed qmake5; it's not in the default $PATH.
You can get the path for its binaries using: pkg info -l qt5-qmake | grep bin
For my setup it's: /usr/local/lib/qt5/bin/qmake
 
Back
Top