Qt correct setup for QMAKESPEC, QTDIR and PATH

When you want to use different configurations for different platforms in your .pro file, it’s necessary to correctly setup three variables: QMAKESPEC, QTDIR and PATH.

Here is how to configure for different platforms:

Microsoft Windows:

In SystemPropertes -> Enviroment variables add/update following values:

QTDIR = P:\QT\4.7.0
PATH = %QTDIR%\bin
LANG = en_US

Unix Bourne shell: (not tested)

export QMAKESPEC PATH</pre>

Unix C shell: (not tested)

setenv QMAKESPEC /usr/local/qt/mkspecs/linux-g++
setenv PATH $PATH:/local/qmake/bin</pre>


You can optionally use LANG variable to setup QtCreator language.

Old qt 3.0 guide: http://doc.trolltech.com/3.0/qmake-guide.html
How to configure enviroment: http://doc.qt.nokia.com/4.0/qmake-environment-reference.html

One comment

  1. Thank you!! I have been strugeling with a problem form 7h and this helped. I’m very grateful.

Leave a Reply

Your email address will not be published. Required fields are marked *