Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get Qt 5.0 working with Qt Creator 2.5.2?

I have just downloaded the source code for Qt 5.0 and compiled it on Ubuntu 12.10 64-bit. Running sudo make install seems to have copied the files to /usr/local/Qt-5.0.0:

enter image description here

So far so good. But when I fire up Qt Creator 2.5.2 and try to point it to the new build, I get an unusual error: The default mkspec symlink is broken.

enter image description here

What could possibly cause this sort of error? All of the symlinks under /usr/local/Qt-5.0.0/mkspecs are valid. The output of qmake -query is as follows:

QT_SYSROOT:
QT_INSTALL_PREFIX:/usr/local/Qt-5.0.0
QT_INSTALL_ARCHDATA:/usr/local/Qt-5.0.0
QT_INSTALL_DATA:/usr/local/Qt-5.0.0
QT_INSTALL_DOCS:/usr/local/Qt-5.0.0/doc
QT_INSTALL_HEADERS:/usr/local/Qt-5.0.0/include
QT_INSTALL_LIBS:/usr/local/Qt-5.0.0/lib
QT_INSTALL_LIBEXECS:/usr/local/Qt-5.0.0/libexec
QT_INSTALL_BINS:/usr/local/Qt-5.0.0/bin
QT_INSTALL_TESTS:/usr/local/Qt-5.0.0/tests
QT_INSTALL_PLUGINS:/usr/local/Qt-5.0.0/plugins
QT_INSTALL_IMPORTS:/usr/local/Qt-5.0.0/imports
QT_INSTALL_QML:/usr/local/Qt-5.0.0/qml
QT_INSTALL_TRANSLATIONS:/usr/local/Qt-5.0.0/translations
QT_INSTALL_CONFIGURATION:/etc/xdg
QT_INSTALL_EXAMPLES:/usr/local/Qt-5.0.0/examples
QT_INSTALL_DEMOS:/usr/local/Qt-5.0.0/examples
QT_HOST_PREFIX:/usr/local/Qt-5.0.0
QT_HOST_DATA:/usr/local/Qt-5.0.0
QT_HOST_BINS:/usr/local/Qt-5.0.0/bin
QMAKE_SPEC:linux-g++-64
QMAKE_XSPEC:linux-g++-64
QMAKE_VERSION:3.0
QT_VERSION:5.0.0

I should also point out that I do not have the Qt 4.x development files installed on this machine:

nathan@nathan-ubuntu:~$ dpkg -l | grep qt4
ii  libqt4-dbus:amd64                         4:4.8.3+dfsg-0ubuntu3                      amd64        Qt 4 D-Bus module
ii  libqt4-declarative:amd64                  4:4.8.3+dfsg-0ubuntu3                      amd64        Qt 4 Declarative module
ii  libqt4-designer:amd64                     4:4.8.3+dfsg-0ubuntu3                      amd64        Qt 4 designer module
ii  libqt4-help:amd64                         4:4.8.3+dfsg-0ubuntu3                      amd64        Qt 4 help module
ii  libqt4-network:amd64                      4:4.8.3+dfsg-0ubuntu3                      amd64        Qt 4 network module
rc  libqt4-opengl:amd64                       4:4.8.3+dfsg-0ubuntu3                      amd64        Qt 4 OpenGL module
rc  libqt4-qt3support:amd64                   4:4.8.3+dfsg-0ubuntu3                      amd64        Qt 3 compatibility library for Qt 4
ii  libqt4-script:amd64                       4:4.8.3+dfsg-0ubuntu3                      amd64        Qt 4 script module
ii  libqt4-scripttools:amd64                  4:4.8.3+dfsg-0ubuntu3                      amd64        Qt 4 script tools module
ii  libqt4-sql:amd64                          4:4.8.3+dfsg-0ubuntu3                      amd64        Qt 4 SQL module
ii  libqt4-sql-sqlite:amd64                   4:4.8.3+dfsg-0ubuntu3                      amd64        Qt 4 SQLite 3 database driver
ii  libqt4-svg:amd64                          4:4.8.3+dfsg-0ubuntu3                      amd64        Qt 4 SVG module
ii  libqt4-test:amd64                         4:4.8.3+dfsg-0ubuntu3                      amd64        Qt 4 test module
ii  libqt4-xml:amd64                          4:4.8.3+dfsg-0ubuntu3                      amd64        Qt 4 XML module
ii  libqt4-xmlpatterns:amd64                  4:4.8.3+dfsg-0ubuntu3                      amd64        Qt 4 XML patterns module
ii  python-qt4                                4.9.3-4                                    amd64        Python bindings for Qt4
ii  python-qt4-dbus                           4.9.3-4                                    amd64        D-Bus Support for PyQt4
like image 809
Nathan Osman Avatar asked Dec 22 '12 03:12

Nathan Osman


2 Answers

You can not make Qt 5 work with Qt Creator prior to version 2.6.1. The patchlevel is important, version 2.6.0 will not work for the final.

Qt 5 is sufficiently different from Qt 4 with its new modules, library names and qmake to require quite a few changes all over the place to get it supported.

like image 68
Tobias Hunger Avatar answered Sep 21 '22 12:09

Tobias Hunger


After upgrading to Qt Creator 2.6.1, the problem went away.

The exact steps for installing v2.6.1 went something like this:

  1. Grab the binary installer from here:

    • 32-bit Linux Installer
    • 64-bit Linux Installer
  2. After you have downloaded the file, change the permissions to 755 with chmod:

    chmod 755 qt-creator-linux-*-opensource-2.6.1.bin
    
  3. Run the installer as root:

    sudo ./qt-creator-linux-*-opensource-2.6.1.bin
    
  4. Leave all of the installation settings at their defaults and finish the installation.

  5. Launch the application through your desktop environment's dash or equivalent.

like image 35
Nathan Osman Avatar answered Sep 22 '22 12:09

Nathan Osman