# Problems with qmake



## kenshi (Feb 27, 2010)

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:


```
qmake -project
qmake
```

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


```
[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:


```
[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.


----------



## sixtydoses (Feb 27, 2010)

Depending on your shell, try the following:


```
export QMAKESPEC=freebsd-g++
```

or


```
setenv QMAKESPEC freebsd-g++
```


----------



## kenshi (Feb 27, 2010)

Well I'm getting a bit closer. After typing the above, qmake no longer gives any errors, but make says the following:


```
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.


----------



## expl (Feb 27, 2010)

Do not forget to use "qmake-qt4" as "qmake" refers to older qt3 API toolset.


----------



## kenshi (Feb 27, 2010)

And that fixed it. Guess the tutorial hasn't been updated in a while. Thanks.


----------



## draco003 (Sep 17, 2014)

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


----------

