Search code examples
linuxqtqmake

qmake using incorrect paths to Qt installation on linux


I compiled qt (qt-everywhere-opensource-src-4.7.4) using:

./configure --prefix=/edrive/local/qt
gmake && gmake install

When I want to make new project with qmake in creates Makefile with wrong include paths and points to wrong binaries and library directories:

> qmake -query "QT_INSTALL_PREFIX"
/edrive/local

in Makefile

includes:

-I/edrive/local/include/QtCore
-I/edrive/local/include/QtGui
-I/edrive/local/include

libs:

-L/edrive/local/lib

uic:

/edrive/local/bin/uic

These are clearly wrong as qt was installed in /edrive/local/qt.

Is there a way to fix this short of manually modifying qt config files? Am I doing something wrong?

Btw, it's selecting correct qmake:

> which qmake
/edrive/local/bin/qt/qmake

Solution

  • You can change that value with:

    # qmake -set VARIABLE VALUE
    

    I.e. in your case with:

    # qmake -set QT_INSTALL_PREFIX /edrive/local/qt
    

    Although judging from your qmake location, you're calling wrong qmake. Try

    /edrive/local/qt/bin/qmake -query "QT_INSTALL_PREFIX"
    

    I have a feeling you have 2 Qt installations aside.