Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Behind the Scenes
  3. Wiki Discussion
  4. Qt5 development primer
Forum Update on Monday, May 27th 2025

Qt5 development primer

Scheduled Pinned Locked Moved Wiki Discussion
166 Posts 72 Posters 201.1k Views
  • 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.
  • S Offline
    S Offline
    stephench77
    wrote on 25 Mar 2013, 04:48 last edited by
    #114

    I am trying to build qt5 on windows. However, I am not even able retrieve the soure code successfully. The inital command "git clone git://gitorious.org/qt/qt5.git qt5" completed successfully. But the next command "perl init-repository" failed with the following error information:

    • git submodule init
      0 [main] us 0 init_cheap: VirtualAlloc pointer is null, Win32 error 487
      AllocationBase 0x0, BaseAddress 0x68560000, RegionSize 0x170000, State 0x10000
      c:\program files (x86)\git\bin\sh.exe: *** Couldn't reserve space for cygwin's h
      eap, Win32 error 0
      git submodule init exited with status 256 at init-repository line 268.
      Qt::InitRepository::exe('Qt::InitRepository=HASH(0x32f290)', 'git', 'sub
      module', 'init') called at init-repository line 373
      Qt::InitRepository::git_submodule_init('Qt::InitRepository=HASH(0x32f290
      )') called at init-repository line 569
      Qt::InitRepository::run('Qt::InitRepository=HASH(0x32f290)') called at i
      nit-repository line 590

    I am using msysgit (Git for Windows) 1.8.1.2, Active Perl 5.16.3 and Python 3.3.0.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sierdzio
      Moderators
      wrote on 25 Mar 2013, 06:15 last edited by
      #115

      Run perl from cmd.exe, not Bash terminal.

      (Z(:^

      1 Reply Last reply
      0
      • S Offline
        S Offline
        stephench77
        wrote on 25 Mar 2013, 06:36 last edited by
        #116

        I did run the command "perl init-repository" from cmd.exe directly.
        [quote author="sierdzio" date="1364192137"]Run perl from cmd.exe, not Bash terminal.[/quote]

        1 Reply Last reply
        0
        • D Offline
          D Offline
          dasun
          wrote on 25 Mar 2013, 18:05 last edited by
          #117

          I'm trying to build source from the for new bug fix which critical for me.

          I'm getting following linking error:

          @ link /NOLOGO /DYNAMICBASE /NXCOMPAT /BASE:0x67000000 /DEBUG /DLL /VERSIO
          N:5.02 /MANIFEST /MANIFESTFILE:....\lib\Qt5Cored.lib.embed.manifest /OUT:....
          lib\Qt5Cored.lib @C:\Users\dasun\AppData\Local\Temp\nm9C85.tmp
          Creating library ....\lib\Qt5Cored.lib and object ....\lib\Qt5Cored.exp
          LINK : fatal error LNK1104: cannot open file '....\lib\Qt5Cored.lib'
          NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0
          \VC\BIN\link.EXE"' : return code '0x450'
          Stop.
          NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0
          \VC\BIN\nmake.exe"' : return code '0x2'
          Stop.
          NMAKE : fatal error U1077: 'cd' : return code '0x2'
          Stop.
          NMAKE : fatal error U1077: 'cd' : return code '0x2'
          Stop.
          NMAKE : fatal error U1077: 'cd' : return code '0x2'
          Stop.@

          1 Reply Last reply
          0
          • S Offline
            S Offline
            stephench77
            wrote on 25 Mar 2013, 18:08 last edited by
            #118

            I am building from Windows 7. I use the following configuration command:

            configure -developer-build -opensource -confirm-license -nomake examples -nomake tests -mp

            I see the following errors at the end of configuration output:

            Generating Visual Studio project files...
            Project WARNING: You should probably load(qt_build_config) first in bootstrap.pr
            o for QtBootstrap, as the latter also load()s qt_module.
            Project MESSAGE: Not doing so may lead to qt_module.prf overriding compiler/link
            er options in your .pro file.
            Project MESSAGE: Ignore this warning with CONFIG+=no_qt_module_warning if you kn
            ow what you are doing.
            Project ERROR: Project has no top-level .qmake.conf file.
            Qmake failed, return code 3

            Generating Makefiles...
            *** qtbase/configure exited with non-zero status.

            1 Reply Last reply
            0
            • A Offline
              A Offline
              anshulsolanki
              wrote on 5 Apr 2013, 16:06 last edited by
              #119

              I am getting following error
              "STL functionality check failed! Cannot build Qt with this STL library."

              when i run configure command i.e.
              ./configure -developer-build -xplatform android-g++ -android-ndk YOUR_NDK_DIR -android-sdk YOUR_SDK_DIR -nomake tests -nomake examples

              Exact dump

              • /home/ubuntu/qt5/qtbase/configure -developer-build -xplatform android-g++ -android-ndk /home/ubuntu/anshul/android-ndk-r8e -android-sdk /home/ubuntu/anshul/replicant-sdk_linux-x86 -nomake tests -nomake examples -confirm-license
                Which edition of Qt do you want to use ?

              Type 'c' if you want to use the Commercial Edition.
              Type 'o' if you want to use the Open Source Edition.

              o

              This is the Qt Open Source Edition.

              You are licensed to use this software under the terms of
              the Lesser GNU General Public License (LGPL) versions 2.1.

              You have already accepted the terms of the license.

              <srcbase> = /home/ubuntu/qt5/qtbase
              <outbase> = /home/ubuntu/qt5/qtbase
              Creating qmake...
              make: Nothing to be done for `first'.
              Running configuration tests...
              Warning: Disabling pkg-config since PKG_CONFIG_LIBDIR is not set.
              Warning: Disabling pkg-config since PKG_CONFIG_SYSROOT_DIR is not set.

              Could not determine the target architecture!
              Turn on verbose messaging (-v) to see the final report.
              STL functionality check failed! Cannot build Qt with this STL library.
              Turn on verbose messaging (-v) to /home/ubuntu/qt5/qtbase/configure to see the final report.
              *** qtbase/configure exited with non-zero status.

              and i am referring this link for building
              http://qt-project.org/wiki/Qt5ForAndroidBuilding

              Please help

              -Anshul

              1 Reply Last reply
              0
              • P Offline
                P Offline
                PauloPina
                wrote on 7 Apr 2013, 18:33 last edited by
                #120

                Hello,

                I am having some problems compiling Qt 5.1 in MAC OSX. I've followed all the steps from here: http://qt-project.org/wiki/Building_Qt_5_from_Git ...

                But... when I called "make -j 4", after about one hour of compilling work, I've got this error:

                @make[3]: *** No rule to make target /Users/paulopina/PlexusDynamics/qt5/qtbase/lib/libQt5QmlDevTools.a', needed by /Users/paulopina/PlexusDynamics/qt5/qtbase/bin/qmlmin'. Stop.
                make[2]: *** [sub-qmlmin-make_first] Error 2
                make[2]: *** Waiting for unfinished jobs....
                make[3]: Nothing to be done for first'. make[3]: Nothing to be done for first'.
                make[3]: Nothing to be done for `first'.
                make[1]: *** [sub-tools-make_first] Error 2
                make: *** [module-qtdeclarative-make_first] Error 2@

                This it the return i've got at "./configure -developer-build -opensource -nomake examples -nomake tests":

                @Creating qmake...
                make: Nothing to be done for `first'.
                Running configuration tests...
                WARNING: Unable to find file .device.vars

                Build type: macx-clang
                Architecture: x86_64, features: mmx sse sse2 sse3 ssse3
                Host architecture: x86_64, features: mmx sse sse2 sse3 ssse3

                Build .................. libs tools
                Configuration .......... qpa largefile precompile_header sse2 sse3 ssse3 sse4_1 sse4_2 avx avx2 absolute_library_soname pcre warnings_are_errors minimal-config small-config medium-config large-config full-config build_all debug_and_release no-pkg-config coreservices accessibility opengl shared qpa reduce_exports getaddrinfo ipv6ifname getifaddrs png freetype system-zlib nis cups iconv openssl rpath corewlan concurrent audio-backend v8 v8snapshot release debug qt_framework private_tests
                Debug .................. yes (combined)
                Default Link ........... debug
                Force debug info ....... no
                C++11 support .......... no
                pkg-config ............. no
                Qt D-Bus module ........ no
                Qt Concurrent code ..... yes
                Qt GUI module .......... yes
                Qt Widgets module ...... yes
                JavaScriptCore JIT ..... To be decided by JavaScriptCore
                QML debugging .......... yes
                PCH support ............ yes
                SSE2/SSE3/SSSE3......... yes/yes/yes
                SSE4.1/SSE4.2........... yes/yes/yes
                AVX/AVX2................ yes/yes
                IPv6 ifname support .... yes
                getaddrinfo support .... yes
                getifaddrs support ..... yes
                Accessibility .......... yes
                NIS support ............ yes
                CUPS support ........... yes
                Iconv support .......... yes
                Glib support ........... no
                GStreamer support ...... no
                PulseAudio support ..... no
                Large File support ..... yes
                GIF support ............ plugin
                JPEG support ........... plugin (qt)
                PNG support ............ yes (qt)
                zlib support ........... system
                Session management ..... auto
                libudev support ........ no
                Use system proxies ..... no
                OpenGL support ......... yes (Desktop OpenGL)
                OpenVG support ......... no
                XShape support ......... auto
                XVideo support ......... auto
                XSync support .......... auto
                Xinerama support ....... runtime
                Xcursor support ........ runtime
                Xfixes support ......... runtime
                Xrandr support ......... runtime
                Xi support ............. runtime
                Xi2 support ............ auto
                MIT-SHM support ........ auto
                FontConfig support ..... no
                XKB support ............ auto
                GTK theme support ...... no
                PostgreSQL support ..... plugin
                ODBC support ........... plugin
                SQLite support ......... plugin (qt)
                OpenSSL support ........ yes (run-time)
                Alsa support ........... no
                CoreWlan support ....... yes
                libICU support ......... no
                PCRE support ........... qt
                Xcb support ............ no
                Xrender support ........ no
                EGLFS support .......... no
                DirectFB support ....... no
                LinuxFB support ........ no
                KMS support ............ no@

                Any one has an idea of how can I solve this?

                Thank you!

                1 Reply Last reply
                0
                • D Offline
                  D Offline
                  deus
                  wrote on 9 Apr 2013, 13:30 last edited by
                  #121

                  [quote author="PauloPina" date="1365359586"]Hello,

                  Thank you![/quote]

                  Just head into "qtdeclarative\src\qmldevtools"
                  and make a release and a debug before you proceed.

                  1 Reply Last reply
                  0
                  • P Offline
                    P Offline
                    PauloPina
                    wrote on 11 Apr 2013, 00:18 last edited by
                    #122

                    [quote author="deus" date="1365514226"]
                    [quote author="PauloPina" date="1365359586"]Hello,

                    Thank you![/quote]

                    Just head into "qtdeclarative\src\qmldevtools"
                    and make a release and a debug before you proceed.

                    [/quote]

                    Hello Deus,

                    Thank you. I'll try it!

                    1 Reply Last reply
                    0
                    • D Offline
                      D Offline
                      DerekDomino
                      wrote on 16 Apr 2013, 16:22 last edited by
                      #123

                      Hi,

                      Same error as PauloPina, then heading to "qtdeclarative\src\qmldevtools" and doing a "make" doesn't solve the problem. The make "has nothing to do". Only the debug lib is created, how do I create the release?

                      Thanks

                      1 Reply Last reply
                      0
                      • D Offline
                        D Offline
                        deus
                        wrote on 16 Apr 2013, 19:30 last edited by
                        #124

                        make release

                        1 Reply Last reply
                        0
                        • D Offline
                          D Offline
                          DerekDomino
                          wrote on 17 Apr 2013, 13:24 last edited by
                          #125

                          Yes, of course I've tried it ;-) but unsuccessfully

                          @
                          $ pwd
                          (...)/qt-everywhere-opensource-src-5.1.0-alpha/qtdeclarative/src/qmldevtools

                          $ ls
                          Makefile qmldevtools.pro

                          $ make release
                          make: *** No rule to make target `release'. Stop.
                          @

                          There's no reference to a 'release' keyword in the Makefile. Here's how the whole qtbase was configured:
                          @
                          $ ./configure -prefix $PWD/qtbase -opensource -nomake tests
                          @

                          I've reconfigured with -debug-and-release option, but still no release rule and other errors raised.

                          @
                          $ ./configure -prefix $PWD/qtbase -opensource -nomake tests -debug-and-release
                          (...)

                          $ make
                          cd qmlmin/ && ( test -e Makefile || (...)/qt-everywhere-opensource-src-5.1.0-alpha/qtbase/bin/qmake (...)/qt-everywhere-opensource-src-5.1.0-alpha/qtdeclarative/tools/qmlmin/qmlmin.pro -o Makefile ) && make -f Makefile
                          make[3]: *** No rule to make target (...)/qt-everywhere-opensource-src-5.1.0-alpha/qtbase/lib/libQt5QmlDevTools.a', needed by (...)/qt-everywhere-opensource-src-5.1.0-alpha/qtbase/bin/qmlmin'. Stop.
                          make[2]: *** [sub-qmlmin-make_first] Error 2
                          make[1]: *** [sub-tools-make_first] Error 2
                          make: *** [module-qtdeclarative-make_first] Error 2
                          @

                          Note: Mac OS X 10.7.5
                          @
                          $ clang -v
                          Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn)
                          Target: x86_64-apple-darwin11.4.2
                          Thread model: posix
                          @

                          1 Reply Last reply
                          0
                          • R Offline
                            R Offline
                            ravirdv
                            wrote on 17 Apr 2013, 18:34 last edited by
                            #126

                            I faced same problem,

                            check out this bug https://bugreports.qt-project.org/browse/QTBUG-30561

                            applying this patch resolved the issue https://codereview.qt-project.org/#patch,sidebyside,52170,1,mkspecs/features/qt_module.prf

                            1 Reply Last reply
                            0
                            • K Offline
                              K Offline
                              kdk85
                              wrote on 5 May 2013, 05:21 last edited by
                              #127

                              Hi,

                              Can the owner of this documentation pls update the steps for running the 'configure' script on Win7+MinGW/MSys.

                              The correct command as pointed by 'JKSH' user is
                              $configure.bat -developer-build -opensource -nomake examples -nomake tests -opengl desktop

                              Links:
                              http://qt-project.org/forums/viewthread/27435/
                              http://qt-project.org/forums/viewthread/22257

                              Thanks

                              1 Reply Last reply
                              0
                              • M Offline
                                M Offline
                                Munawwar
                                wrote on 18 May 2013, 21:13 last edited by
                                #128

                                I think the wiki should mention that the build needs at least 3 GB of RAM to build WebKit.

                                1 Reply Last reply
                                0
                                • S Offline
                                  S Offline
                                  sierdzio
                                  Moderators
                                  wrote on 18 May 2013, 21:48 last edited by
                                  #129

                                  You can edit it any time.

                                  (Z(:^

                                  1 Reply Last reply
                                  0
                                  • M Offline
                                    M Offline
                                    Munawwar
                                    wrote on 19 May 2013, 18:12 last edited by
                                    #130

                                    I was getting a "runtime/CodeCache.cpp
                                    The bug is not reproducible, so it is likely a hardware or OS problem."
                                    error when using make -j 4.
                                    I had to do a make without specifying '-j 4' (which "I think is serial execution":http://www.gnu.org/software/make/manual/html_node/Parallel.html) for the build to work.

                                    1 Reply Last reply
                                    0
                                    • S Offline
                                      S Offline
                                      sierdzio
                                      Moderators
                                      wrote on 19 May 2013, 18:16 last edited by
                                      #131

                                      Uncanny.

                                      I'm routinely compiling various Qt versions, from 4.8 to 5.1, with make -j9 and never had an issue. Well, once :)

                                      Maybe your "make" is outdated?

                                      (Z(:^

                                      1 Reply Last reply
                                      0
                                      • JKSHJ Offline
                                        JKSHJ Offline
                                        JKSH
                                        Moderators
                                        wrote on 20 May 2013, 00:08 last edited by
                                        #132

                                        [quote author="Munawwar" date="1368987136"]I was getting a "runtime/CodeCache.cpp
                                        The bug is not reproducible, so it is likely a hardware or OS problem."
                                        error when using make -j 4.
                                        I had to do a make without specifying '-j 4' (which "I think is serial execution":http://www.gnu.org/software/make/manual/html_node/Parallel.html) for the build to work.[/quote]What CPU, and how much RAM, do you have?

                                        Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                                        1 Reply Last reply
                                        0
                                        • A Offline
                                          A Offline
                                          allenck
                                          wrote on 23 May 2013, 21:45 last edited by
                                          #133

                                          I'm having problems getting Qt 5.1 to compile:

                                          In file included from ../../include/QtWidgets/qgraphicsscene.h:1:0,
                                          from ../../include/QtWidgets/5.1.0/QtWidgets/private/../../../../../src/widgets/graphicsview/qgraphicsview.h:48,
                                          from ../../include/QtWidgets/5.1.0/QtWidgets/private/../../../../../src/widgets/graphicsview/qgraphicsview_p.h:56,
                                          from ../../include/QtWidgets/5.1.0/QtWidgets/private/qgraphicsview_p.h:1,
                                          from ../../include/QtWidgets/5.1.0/QtWidgets/private/../../../../../src/widgets/graphicsview/qgraphicsitem_p.h:59,
                                          from ../../include/QtWidgets/5.1.0/QtWidgets/private/../../../../../src/widgets/graphicsview/qgraphicswidget_p.h:57,
                                          from ../../include/QtWidgets/5.1.0/QtWidgets/private/qgraphicswidget_p.h:1,
                                          from kernel/qaction_p.h:58,
                                          from kernel/qactiongroup.cpp:46:
                                          ../../include/QtWidgets/../../src/widgets/graphicsview/qgraphicsscene.h:160:24: error: missing binary operator before token "("
                                          ../../include/QtWidgets/../../src/widgets/graphicsview/qgraphicsscene.h:167:24: error: missing binary operator before token "("
                                          ../../include/QtWidgets/../../src/widgets/graphicsview/qgraphicsscene.h:174:24: error: missing binary operator before token "("
                                          In file included from ../../include/QtWidgets/5.1.0/QtWidgets/private/../../../../../src/widgets/graphicsview/qgraphicsitem_p.h:56:0,
                                          from ../../include/QtWidgets/5.1.0/QtWidgets/private/../../../../../src/widgets/graphicsview/qgraphicswidget_p.h:57,
                                          from ../../include/QtWidgets/5.1.0/QtWidgets/private/qgraphicswidget_p.h:1,
                                          from kernel/qaction_p.h:58,
                                          from kernel/qaction.cpp:46:
                                          ../../include/QtWidgets/5.1.0/QtWidgets/private/../../../../../src/widgets/graphicsview/qgraphicsitem.h:176:24: error: missing binary operator before token "("
                                          ../../include/QtWidgets/5.1.0/QtWidgets/private/../../../../../src/widgets/graphicsview/qgraphicsitem.h:240:24: error: missing binary operator before token "("
                                          ../../include/QtWidgets/5.1.0/QtWidgets/private/../../../../../src/widgets/graphicsview/qgraphicsitem.h:298:24: error: missing binary operator before token "("
                                          In file included from ../../include/QtWidgets/qgraphicsscene.h:1:0,
                                          from ../../include/QtWidgets/5.1.0/QtWidgets/private/../../../../../src/widgets/graphicsview/qgraphicsview.h:48,
                                          from ../../include/QtWidgets/5.1.0/QtWidgets/private/../../../../../src/widgets/graphicsview/qgraphicsview_p.h:56,
                                          from ../../include/QtWidgets/5.1.0/QtWidgets/private/qgraphicsview_p.h:1,
                                          from ../../include/QtWidgets/5.1.0/QtWidgets/private/../../../../../src/widgets/graphicsview/qgraphicsitem_p.h:59,
                                          from ../../include/QtWidgets/5.1.0/QtWidgets/private/../../../../../src/widgets/graphicsview/qgraphicswidget_p.h:57,
                                          from ../../include/QtWidgets/5.1.0/QtWidgets/private/qgraphicswidget_p.h:1,
                                          from kernel/qaction_p.h:58,
                                          from kernel/qaction.cpp:46:
                                          ../../include/QtWidgets/../../src/widgets/graphicsview/qgraphicsscene.h:160:24: error: missing binary operator before token "("
                                          ../../include/QtWidgets/../../src/widgets/graphicsview/qgraphicsscene.h:167:24: error: missing binary operator before token "("
                                          ../../include/QtWidgets/../../src/widgets/graphicsview/qgraphicsscene.h:174:24: error: missing binary operator before token "("
                                          In file included from kernel/qactiongroup.cpp:382:0:
                                          .moc/release-shared/moc_qactiongroup.cpp:15:2: error: #error "This file was generated using the moc from 5.1.0. It"
                                          .moc/release-shared/moc_qactiongroup.cpp:16:2: error: #error "cannot be used with the include files from this version of Qt."
                                          .moc/release-shared/moc_qactiongroup.cpp:17:2: error: #error "(The moc has changed too much.)"
                                          In file included from ../../include/QtWidgets/qaction.h:1:0,
                                          from kernel/qactiongroup.h:45,
                                          from kernel/qactiongroup.cpp:42:
                                          ../../include/QtWidgets/../../src/widgets/kernel/qaction.h:61:32: error: expected initializer before ‘:’ token
                                          In file included from kernel/qaction.cpp:1313:0:
                                          .moc/release-shared/moc_qaction.cpp:15:2: error: #error "This file was generated using the moc from 5.1.0. It"
                                          .moc/release-shared/moc_qaction.cpp:16:2: error: #error "cannot be used with the include files from this version of Qt."
                                          .moc/release-shared/moc_qaction.cpp:17:2: error: #error "(The moc has changed too much.)"
                                          In file included from kernel/qaction.cpp:42:0:
                                          kernel/qaction.h:61:32: error: expected initializer before ‘:’ token
                                          make[3]: *** [.obj/release-shared/qactiongroup.o] Error 1
                                          make[3]: *** Waiting for unfinished jobs....
                                          make[3]: *** [.obj/release-shared/qaction.o] Error 1
                                          make[3]: Leaving directory /media/usb_700_ext4/qt5/qtbase/src/widgets' make[2]: *** [sub-widgets-make_first] Error 2 make[2]: Leaving directory /media/usb_700_ext4/qt5/qtbase/src'
                                          make[1]: *** [sub-src-make_first] Error 2
                                          make[1]: Leaving directory `/media/usb_700_ext4/qt5/qtbase'
                                          make: *** [module-qtbase-make_first] Error 2
                                          allen@ubuntu:/media/usb_700_ext4/qt5$

                                          Can anybody explain why?

                                          Allen Kempe

                                          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