Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Install Qt 5.0 and Qt Creator on Ubuntu
Forum Updated to NodeBB v4.3 + New Features

Install Qt 5.0 and Qt Creator on Ubuntu

Scheduled Pinned Locked Moved Installation and Deployment
11 Posts 3 Posters 15.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Z Offline
    Z Offline
    Zedex18
    wrote on last edited by
    #1

    Hi everyone.
    I've just installed Qt 5.0 on my computer. Qt Creator has been installed with and a shortcut appears, but does not works ans when I launch it manually I get the error message :
    @cedric@cedric-laptop:~$ cd /opt/Qt5.0.0/Tools/QtCreator/bin/
    cedric@cedric-laptop:/opt/Qt5.0.0/Tools/QtCreator/bin$ ./qtcreator
    Failed to load platform plugin "xcb". Available platforms are:
    linuxfb
    minimal
    xcb

    Abandon
    @

    What should I do ?
    Thanks.

    1 Reply Last reply
    0
    • Y Offline
      Y Offline
      yodermk
      wrote on last edited by
      #2

      I haven't tried on Ubuntu and my Ubuntu system is off right now but have you tried:

      apt-cache search xcb

      and installed what it finds?

      1 Reply Last reply
      0
      • sierdzioS Offline
        sierdzioS Offline
        sierdzio
        Moderators
        wrote on last edited by
        #3

        You need to install dependencies mentioned here: "link":http://qt-project.org/wiki/Building_Qt_5_from_Git. You don't need python and perl, the rest is required.

        (Z(:^

        1 Reply Last reply
        0
        • Z Offline
          Z Offline
          Zedex18
          wrote on last edited by
          #4

          With sierdzio's link, I installed Libxcb and now it works.
          @sudo apt-get install "^libxcb.*" libx11-xcb-dev libglu1-mesa-dev libxrender-dev@

          But I can not create a new project : at the Kit selection, there is "No valid kits found". In the options "Qt version" there is nothing, and in "kits" there is only "manual, desktop (default)".

          I have the quite same error on my computer with Windows 7 : I can create a project, but can not build it by the same reasons.

          1 Reply Last reply
          0
          • sierdzioS Offline
            sierdzioS Offline
            sierdzio
            Moderators
            wrote on last edited by
            #5

            Maybe you have missed installation of a compiler, too? If you are using precompiled packages, you'll need g++ on Linux (clang might also work), and MSVC2010 on Windows (available from MS SDK 7 or MS VisualStudio 2k10).

            Then you'll just need to check your kits (to see if QtC has picked up recent changes).

            (Z(:^

            1 Reply Last reply
            0
            • Z Offline
              Z Offline
              Zedex18
              wrote on last edited by
              #6

              I already cpp programs with both computers (under eclipse IDE with gcc for ubuntu, and code::blocks with mingw for windows). You mean I should install more compilers ?

              1 Reply Last reply
              0
              • sierdzioS Offline
                sierdzioS Offline
                sierdzio
                Moderators
                wrote on last edited by
                #7

                (Windows) If you have not compiled yourself, then you need to install MSVC 2010. MinGW and MSVC are not compatible.

                (Linux) You should be ready to go.

                For kits to work, you need to have valid compiler listed in compilers section, and a Qt added in Qt Versions. Then you can build a kit: just specify a name, compiler to be used, and Qt version you want.

                (Z(:^

                1 Reply Last reply
                0
                • Z Offline
                  Z Offline
                  Zedex18
                  wrote on last edited by
                  #8

                  All right. In ubuntu I did not specified the Qt version in kits, that is why it does not worked but now it's okay (except some problems in my code, but I think it is because I follow an old tutorial).
                  In fact, I get error with this code ... :
                  @#include <QtWidgets/QApplication>

                  int main(int argc, char* argv[])
                  {
                  QApplication app(argc, argv);

                  return app.exec&#40;&#41;;
                  

                  }@

                  I get errors on the QApplication. It seems I do not give the good arguments.

                  1 Reply Last reply
                  0
                  • sierdzioS Offline
                    sierdzioS Offline
                    sierdzio
                    Moderators
                    wrote on last edited by
                    #9

                    Code is fine, if a bit short ;)

                    You've probably missed QT += gui widgets in your .pro file. A lot of people seem to be missing that point lately.

                    (Z(:^

                    1 Reply Last reply
                    0
                    • Z Offline
                      Z Offline
                      Zedex18
                      wrote on last edited by
                      #10

                      All right, everything works perfectly. Thanks you a lot. But it's the first time I see I should add QT += gui widgets in the .pro file. I should not forget it next time.

                      1 Reply Last reply
                      0
                      • sierdzioS Offline
                        sierdzioS Offline
                        sierdzio
                        Moderators
                        wrote on last edited by
                        #11

                        There were changes in modules in Qt5. QtGui was split into QtGui (a common base for QtQuick and QtWidgets) and QtWidgets.

                        So if you are using widgets, you need to include both QtGui and QtWidgets in your .pro file. If you are using QML, you need QtGui, QtQml and QtQuick.

                        (Z(:^

                        1 Reply Last reply
                        0

                        • Login

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • Users
                        • Groups
                        • Search
                        • Get Qt Extensions
                        • Unsolved