Search code examples
linuxqtqt4qt-creatorqmake

Qt version is invalid


I am working on Linux and I have installed Qt Creator 2.5.2, Qt libraries 4.7.4 and 4.4.3 all from sources. I cannot install the binaries directly for incompatibility between versions. The installation processes for both Qt 4.7.4 and Qt 4.4.3 were the same. The issue I am facing is that Qt Creator recognizes Qt 4.7.4 but not Qt 4.4.3, with the error

The Qt version is invalid : Could not determine the path to the binaries of the Qt installation, maybe the path is wrong.

Well each library is installed in /home/$username/qt/Qt-$version. When I manually compile a project with

cd directory
/home/$username/qt/Qt-4.4.3/qmake $PATHPRO
make

Everything work as a charm and I can run the app.

What did I tried?

  • Recompile Qt-4.4.3
  • Check the folder permissions
  • Restart Qt Creator
  • Smash my head on my desktop

Any thoughts? The OS is SUSE Enterprise 11-32bits.


Solution

  • Problem solved :D.

    QtCreator find libraries by using some qmake properties. It query for these properties by executing the command qmake -query. The issue was that none of these variables were set in the Qt 4.4.3 library while they were present in the Qt 4.7.4 library.

    So the solution is to set the properties using

     home/$username/qt/Qt-4.4.3/bin/qmake -set VARIABLE VALUE
    

    where value is usually a path to a directory

    Variables in 4.7.4:

     QT_INSTALL_PREFIX: home/$username/qt/Qt-4.7.4/
     QT_INSTALL_DATA:
     QT_INSTALL_DOCS:
     QT_INSTALL_HEADERS:
     QT_INSTALL_LIBS:
     QT_INSTALL_BINS:
     QT_INSTALL_PLUGINS:
     QT_INSTALL_IMPORTS:
     QT_INSTALL_TRANSLATIONS:
     QT_INSTALL_CONFIGURATION:
     QT_INSTALL_EXAMPLES:
     QT_INSTALL_DEMOS:
     QMAKE_MKSPECS: 
     QMAKE_VERSION:2.01a
     QT_VERSION:4.7.4
    

    I think the most important are QT_INSTALL_LIBS, QT_INSTALL_LIBS and QT_VERSION. see configuring qmake environment.