Important: Please read the Qt Code of Conduct -

Qt5 development primer

  • After compiling Qt5 I'd like to do a safe "make install" in my system. With "safe" I mean that I don't want to overwtite my Qt4 libs on my system so they should be installed in (for example) /opt/qt5 if it's possible.

    I also would like to start packaging Qt5 in a Ubuntu PPA, but even if I've a little experience with packaging, I really don't know how to split an installation in multiple packages (I mean: qt-multimedia, qt-database, qt-tools ecc.... just to make you an example): should I take example from the actual Qt4 packages available in Ubuntu? Anyone want to help me? Thanks!

  • How do you force qtbase/src/plugins/platforms/xcb to recompile?

  • I get this at every dir level I tried on Archlinux x86_64...
    @~qt5-git/qtbase git submodule update --init src/3rdparty/v8
    You need to run this command from the toplevel of the working tree.@
    I already have a libv8 as part of my system so would it possible for qtbase and whatever else needs libv8 to just link against my system version?

  • Hi! Trying to build Qt 5 for the first time, but I'm not getting very far...
    Seems like the init-repository script is not working properly with the the --http option. All the repos are cloned using "http:", except for the qt3d repo which still tries to use "git:".
    Very simple problem, but with my total lack of experience with perl, I'm not sure how to work around it... If anyone could give me a hint on how to get past this, by fixing init-repository, or doing some manual step, it would be most appreciated.

  • What is the best way to incorporate qtwebkit into a qt5 build?
    [pid 30835] open(".../qt5-git/.git/modules/qtwebkit/refs/heads/master", O_RDONLY) = -1 ENOENT (No such file or directory)
    [pid 30835] write(2, "fatal: Oops\n", 12fatal: Oops@

    @ludde, I'm not sure why there is not some plain English instructions to clone the repo exactly, or a bash script, rather than buried inside an obfuscated perl script that doesn't seem to work. An example .git/config file would be more useful.

  • Managed to make init-repository clone all the modules (by fiddling a bit with the perl script, without really understanding what I was doing...).

    Also managed to run configure. But compiling (using Microsoft Visual Studio 2005, on Windows 7, 64 bit) eventually fails:

    c:\users\ludde\qt\qt5\qtbase\src\plugins\platforms\windows\qtwindowsglobal.h(178) : error C2065: 'WM_XBUTTONDOWN' : undeclared identifier
    c:\users\ludde\qt\qt5\qtbase\src\plugins\platforms\windows\qtwindowsglobal.h(178) : error C2065: 'WM_XBUTTONDBLCLK' : undeclared identifier
    c:\users\ludde\qt\qt5\qtbase\src\plugins\platforms\windows\qwindowscontext.h(74) : error C2059: syntax error : '<L_TYPE_raw>'

    Any ideas on what might be causing this?

  • Moderators

    @ludde: I filed regarding your problems with the -http option. About the windows problems ... don't know, it compiles for me :( I guess you're better off subscribing to, and posting your problems there.

  • While running
    @./configure -developer-build -opensource -nomake examples -nomake tests@

    i get this error partway through:

    @Creating qmake. Please wait...
    g++ -c -o project.o -pipe -DQMAKE_OPENSOURCE_EDITION -g -g -I. -Igenerators -Igenerators/unix -Igenerators/win32 -Igenerators/mac -Igenerators/integrity -I/home/daniel/qt5/qtbase/include -I/home/daniel/qt5/qtbase/include/QtCore -I/home/daniel/qt5/qtbase/include/QtCore/5.0.0 -I/home/daniel/qt5/qtbase/include/QtCore/5.0.0/QtCore -I/home/daniel/qt5/qtbase/src/corelib/global -I/home/daniel/qt5/qtbase/src/corelib/xml -I/home/daniel/qt5/qtbase/tools/shared -DQT_NO_PCRE -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_COMPONENT -DQT_NO_STL -DQT_NO_COMPRESS -I/home/daniel/qt5/qtbase/mkspecs/linux-g++ -DHAVE_QCONFIG_CPP -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DEPRECATED project.cpp
    make: g++: Command not found
    make: *** [project.o] Error 127

    I am using ubuntu, does anyone know where i went wrong?
    Sorry i'm rather new to all this :$

  • Do you have gcc installed...?

  • Had this problem too. For some reason you need not only have gcc installed, but have it available as g++. This can be accomplished by installing the g++ package (and possibly also by just creating an alias from g++ to gcc, but I didn't try this).

  • Ah thanks, that works, i had gcc installed but not g++ it seems.

    Strangely, i cannot run demos as even if i make the executables runnable, then i get something like this:
    @Details: Failed to execute child process "/usr/bin/tea_service" (No such file or directory)@

    after making the qt teaservice.desktop demo executable as a program in its right click properties and trying to run.
    Somehow i get the impression that this is not what i am meant to be doimng anyway, as the idea that i would have to right click and change the permissions of all the demo files that i wanted to run doesn't seem the most fun so i guess i am trying to do it the wrong way :$

    Also, i tried to compile qt creator and the qtquick3d demos myself and got errors.
    (For example, for the qtquick3d):
    @daniel@andy-desktop:~/qt_creator/what$ qmake /home/daniel/qt5/qtquick3d/demos/
    daniel@andy-desktop:~/qt_creator/what$ sudo make
    cd quick3d/ && /home/daniel/qt5/qtbase/bin/qmake /home/daniel/qt5/qtquick3d/demos/quick3d/ -o Makefile
    cd quick3d/ && make -f Makefile
    make[1]: Entering directory /home/daniel/qt_creator/what/quick3d' cd model_viewer/ && /home/daniel/qt5/qtbase/bin/qmake /home/daniel/qt5/qtquick3d/demos/quick3d/model_viewer/ -o Makefile cd model_viewer/ && make -f Makefile make[2]: Entering directory/home/daniel/qt_creator/what/quick3d/model_viewer'
    g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_DECLARATIVE_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I../../../../qt5/qtbase/mkspecs/linux-g++ -I../../../../qt5/qtquick3d/demos/quick3d/model_viewer -I../../../../qt5/qtbase/include/QtCore -I../../../../qt5/qtbase/include/QtGui -I../../../../qt5/qtbase/include/QtWidgets -I../../../../qt5/qtdeclarative/include -I../../../../qt5/qtdeclarative/include/QtDeclarative -I../../../../qt5/qtbase/include -I../../../../qt5/qtbase/include/QtNetwork -I../../../../qt5/qtxmlpatterns/include -I../../../../qt5/qtxmlpatterns/include/QtXmlPatterns -I/usr/X11R6/include -I. -I../../../../qt5/qtquick3d/demos/quick3d/model_viewer -I. -o main.o ../../../../qt5/qtquick3d/demos/quick3d/model_viewer/main.cpp
    In file included from ../../../../qt5/qtbase/include/QtGui/qopengl.h:1:0,
    from ../../../../qt5/qtdeclarative/include/QtDeclarative/../../src/declarative/items/qquickcanvas.h:46,
    from ../../../../qt5/qtdeclarative/include/QtDeclarative/qquickcanvas.h:1,
    from ../../../../qt5/qtdeclarative/include/QtDeclarative/../../src/declarative/items/qquickview.h:46,
    from ../../../../qt5/qtdeclarative/include/QtDeclarative/qquickview.h:1,
    from ../../../../qt5/qtdeclarative/include/QtDeclarative/QQuickView:1,
    from ../../../../qt5/qtquick3d/demos/quick3d/model_viewer/../qmlres.h:47,
    from ../../../../qt5/qtquick3d/demos/quick3d/model_viewer/main.cpp:42:
    ../../../../qt5/qtbase/include/QtGui/../../src/gui/opengl/qopengl.h:69:21: fatal error: GL/gl.h: No such file or directory
    compilation terminated.
    make[2]: *** [main.o] Error 1
    make[2]: Leaving directory /home/daniel/qt_creator/what/quick3d/model_viewer' make[1]: *** [sub-model_viewer-make_default] Error 2 make[1]: Leaving directory/home/daniel/qt_creator/what/quick3d'
    make: *** [sub-quick3d-make_default] Error 2

    Sorry to be a pain.

  • Greetings guys,

    On Windows 7 x64 I get the following:

    @qwindowstheme.cpp: In member function 'virtual QVariant QWindowsTheme::themeHint(QPlatformTheme::ThemeHint) const': qwindowstheme.cpp:77:53: error: 'SPI_GETDROPSHADOW' was not declared in this scope@

    It seems that the SPI_GETDROPSHADOW is under a WIN_NT_32 define.

  • I just restarted my attempt at building Qt5 after spending a day finding out that wayland isn't ready for Debian Wheezy amd64 yet.

    By running configure with the "-v" switch I could see the auto-detection tests and their results - I needed to install libasound2-dev for Alsa.

    @make confclean@

    does nothing - "confclean" isn't a valid makefile target, although configure tells you to use this to clean up before another configure run.

    Maybe someone could add
    <tab>git submodule foreach --recursive 'git clean -dfx'@

    to the right makefile to tie things up.

    Also, see the
    @qtbase/configure: 7201: [: x86_64: unexpected operator@

    error after the "rm -f ..." entries below.

    The error is
    @if [ -n "$_SBOX_DIR" -a "$CFG_ARCH" == "arm" ]; then@

    This is a "bashism" - something only bash understands.
    Although /bin/sh was usually symlinked to /bin/bash, on Debian Wheezy /bin/sh -> dash.

    "dash" and therefore "sh" doesn't recognise "[" and doesn't like "==".

    @if test -n "$_SBOX_DIR" && test "$CFG_ARCH" = "arm"; then@

    It occurs lots of times in this configure script - maybe in others too.

    Somehow it muddles through. I'd recommend using "set -e" to catch these.

    Anyway here's my configure output, after doing the recursive clean command above.


    • /v3c/dev/Graphics/Qt/qt5/qtbase/configure -prefix /v3c/dev/Graphics/Qt/qt5/qtbase -no-wayland -opengl -no-glib -opensource -confirm-license -qpa -v
      Determining system architecture... (Linux:3.0.0-1-amd64:x86_64)
      64-bit AMD 80x86 (x86_64)
      'x86_64' is supported
      System architecture: 'x86_64'
      Host architecture: 'x86_64'
      Precompiled-headers support enabled.
      Symbol visibility control enabled.
      Symbolic function binding enabled.

    This is the Qt Lighthouse 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.
    bootstrapping and feature tests...

    /v3c/dev/Graphics/Qt/qt5/qtbase/configure: 7201: [: x86_64: unexpected operator
    Testing size of pointers ... (/v3c/dev/Graphics/Qt/qt5/qtbase/mkspecs/linux-g++-64 yes /v3c/dev/Graphics/Qt/qt5/qtbase /v3c/dev/Graphics/Qt/qt5/qtbase)
    rm -f ptrsizetest.o
    rm -f *~ core *.core
    g++ -c -m64 -pipe -O2 -Wall -W -I../../../mkspecs/linux-g++-64 -I. -o ptrsizetest.o ptrsizetest.cpp
    g++ -m64 -Wl,-O1 -o ptrsizetest ptrsizetest.o
    Pointer size: 8
    ln: failed to create symbolic link /v3c/dev/Graphics/Qt/qt5/qtbase/include/QtCore/qconfig.h': File exists ln: failed to create symbolic link/v3c/dev/Graphics/Qt/qt5/qtbase/include/Qt/qconfig.h': No such file or directory

        This target is using the GNU C++ compiler (linux-g++-64).
        Recent versions of this compiler automatically include code for
        exceptions, which increase both the size of the Qt libraries and
        the amount of memory taken by your applications.
        You may choose to re-run configure with the -no-exceptions
        option to compile Qt without exceptions. This is completely binary
        compatible, and existing applications will continue to work.

    Build type: linux-g++-64
    Architecture: x86_64
    Host architecture: x86_64
    Platform notes:

            - Also available for Linux: linux-kcc linux-icc linux-cxx

    qmake vars .......... cat: .qmake.vars: No such file or directory
    qmake switches .........
    Build .................. libs examples tests
    Configuration .......... release shared dll qpa largefile stl precompile_header mmx 3dnow sse sse2 sse3 ssse3 sse4_1 sse4_2 avx minimal-config small-config medium-config large-config full-config fontconfig xlib xrender xcb-render accessibility openvg opengl qpa reduce_exports reduce_relocations clock-gettime clock-monotonic mremap getaddrinfo ipv6ifname getifaddrs inotify system-jpeg system-png png system-tiff system-freetype system-zlib nis cups dbus openssl xcb alsa concurrent audio-backend svg v8 v8snapshot release
    Debug .................. no
    QtDBus module .......... yes (run-time)
    QtConcurrent code ...... yes
    QtGui module ........... yes
    QtScript module ........ yes
    QtScriptTools module ... yes
    QtXmlPatterns module ... yes
    Phonon module .......... no
    Multimedia module ...... auto
    SVG module ............. yes
    WebKit module .......... yes
    JavaScriptCore JIT ..... To be decided by JavaScriptCore
    V8 module .............. yes
    Declarative module ..... yes
    Declarative debugging ...yes
    Location module ........ no
    STL support ............ yes
    PCH support ............ yes
    MMX/3DNOW/SSE/SSE2/SSE3. yes/yes/yes/yes/yes
    SSSE3/SSE4.1/SSE4.2..... yes/yes/yes
    AVX..................... yes
    IPv6 ifname support .... yes
    getaddrinfo support .... yes
    getifaddrs support ..... yes
    Accessibility .......... yes
    NIS support ............ yes
    CUPS support ........... yes
    Iconv support .......... no
    Glib support ........... no
    GStreamer support ...... no
    PulseAudio support ..... no
    Large File support ..... yes
    GIF support ............ plugin
    TIFF support ........... plugin (system)
    JPEG support ........... plugin (system)
    PNG support ............ yes (system)
    zlib support ........... system
    Session management ..... auto
    OpenGL support ......... yes (Desktop OpenGL)
    OpenVG support ......... yes
    MySQL support .......... plugin
    PostgreSQL support ..... plugin
    SQLite support ......... plugin (qt)
    OpenSSL support ........ yes (run-time)
    Alsa support ........... yes
    libICU support ......... no
    Xcb support ............ limited (old version)
    Xrender support ........ yes

  • Here's a list of files I had to modify on my way to discovering that libQtdesigner is needed for qtbase/plugins/designer/ but wasn't built yet.

    This needs "Qt += quick"

    This needs to "#include <QNetworkCookie>"

    This uses " QTouchEvent::TouchPoint::Primary" - I commented it (and the "if" statement) out to get further.

    This needs "Qt += quick"

    This needs to "#include <QNetworkCookie>"

    These need "Qt += quick"

    This wasn't tested with "regular" OpenGL

    Here's the change I made to it.
    #if PLATFORM(QT)
    static void* getProcAddress(const char* procName)

    • return QGLContext::currentContext()->getProcAddress(QString::fromLatin1(procName));
    • return (void *)QGLContext::currentContext()
    •    ->getProcAddress(QString::fromLatin1(procName));

    typedef void* (glGetProcAddressType) (const char procName);

    These assume they're only included from within WebKit - untrue.
    Yes, I later realized that this isn't the right place to change them.

    Hope this helps.

  • I had to choose between OpenGL and GL ES2 but I could also select xcb.

    Isn't qpa building about being able to select between all of these at run-time?

    On Debian Wheezy I've got the libraries and development packages installed to support OpenGL and GL ES2.

    Also, maybe "build.stamp" and "install.stamp" files marking modules as built/installed could help "make" or "make install" skip modules entirely and speed things up.

    If specifying "-prefix $PWD/qtbase" is your way of saying Qt5 isn't ready for "-prefix /usr" then you could have made that point a little more prominently.

  • Moderators

    Philius, I think it would be nice if you posted your findings to Qt development mailing list, where devs are likely to pick it up. And/ or modifying the "Building Qt5 from Git": wiki page might be a good idea.

  • I re-subscribed and posted an email with a QtWebkit patch although my build still (eventually) fails.

    I think that as long as the install prefix is inside the source tree (not to mention the build path!) you're going to have problems, so I won't try it again at least until these things change.

    From trying to fix problems I noticed that there are several "Release" directories created in the source tree - it looks like someone was at least trying to do some whacky kind of out-of-source-while-still-in-source deal.

    Do a "find . -type d -name Release" once you've tried to build it at least once to see the strangeness.

    I also noticed that the build process was picking header files from the install path in preference to the source directory - I've got projects that use automake that don't do that (it's a shame automake can't do the same for libraries).

    Then there's "make install" trying to copy files over themselves.

    I'll stop here.

  • Those "QT += quick" are needed on Debian Wheezy because of
    ld.bfd: "could not read symbols: Invalid operation" after indirect reference is unhelpful

  • I can confirm that all of changes mentioned by Philius are required to build on OSX.

    I also needed to add - "QT += quick" to the following files:


    Philius - I think there are a few small mistakes in your earlier post which may be misleading to some - you say add "Qt += quick" which I believe should be "QT += quick" with upper case T

  • Yep.
    While packaging my projects to get them into Debian I had my wrist slapped for referring to Qt as QT, which is QuickTime.
    It must have stuck in my head.
    They're spelled correctly in the patch, and anyway sometimes you have to append "quick" to the existing "QT =" or "QT +=" line.

  • Very true about appending it in some cases.

    I was wondering have you been testing qtwebkit at all? On OSX the build seems to be adding incorrect paths from the binaries to the dynamic libraries. I've fixed them up but MiniBrowser and QtTestBrowser are still not quite working properly yet. I'm going to look into it more later. I just wondered if the situation was looking any better on Linux? I'm going to try building on Ubuntu next.

  • I just started a shadow build.
    Here's the makefile (same dir as qt5).
    all: config
    cd qt5-build;
    export PATH="${PATH}:$$(readlink -f qtbase/bin)";
    make -j 2 && make install

    config: #clean
    mkdir -p qt5-build
    mkdir -p qt5-install
    cd qt5-build;
    if test ! -f config.stamp; then
    ../qt5/configure -prefix $$(readlink -f ../qt5-install) -no-wayland
    -no-openvg -opengl es2 -opensource -confirm-license -v
    -I /usr/include/gstreamer-0.10
    -I /usr/include/glib-2.0
    -I /usr/lib/x86_64-linux-gnu/glib-2.0/include
    -I /usr/include/libxml2
    2>&1 | tee make.txt;
    touch config.stamp;
    echo "Config target already done.";

    #cd qt5; git submodule foreach --recursive 'git clean -dfx'
    rm -fr qt5-build

    The includes are for gstreamer support.

    It looks like OpenVG and Phonon aren't ready yet.
    The error for them is "QMAKESPEC has not been set, so configuration cannot be deduced".

    I'll report back when it's done.

  • It looks like the build system doesn't track configure changes - gstreamer seems to require phonon.

    I'll "make clean" and "try" yet again.

  • Out of source builds definitely don't work, although this could change with new updates.

    I'm not sure why the separate packages aren't "configure && make && make install" -able individually.
    Maybe this is just to get them built quicker, but then they aren't really separate packages.

    Also, providing text instructions that (currently) conflict with the README in git isn't helpful.
    One of them should change.

    Next, there should be a top-level "make" script which builds the tested configuration.
    export "$ROOT" to the absolute path to the qt5 directory for the comments below.
    I added
    @export QMAKESPEC="linux-g++-64"@

    otherwise svg and phonon modules fail.

    I added
    @-prefix ${ROOT}/qtbase@

    otherwise qmake won't find qmodule.pri.

    I added
    @export PATH="${ROOT}/qtbase/bin:${PATH}"@

    To use the binaries built in the build tree and not those installed on my system.

    It still fails with the following error:
    ../../../../Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp: In member function ‘void WebCore::GraphicsContext3DPrivate::blitMultisampleFramebuffer() const’:
    ../../../../Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp:261:23: error: ‘GL_READ_FRAMEBUFFER_EXT’ was not declared in this scope
    ../../../../Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp:262:23: error: ‘GL_DRAW_FRAMEBUFFER_EXT’ was not declared in this scope
    make[6]: *** [obj/release-static/platform/graphics/qt/GraphicsContext3DQt.o] Error 1

    GL_READ_FRAMEBUFFER_EXT is defined in GL/glext.h but not in OpenGL ES2, at least not in Wheezy amd64.

  • Sorry for editing my messages but the ground is moving under me.

    I rebuilt with "regular" OpenGL and found one more problem:
    qtwebkit-examples-and-demos/examples/browser/cookiejar.cpp is missing "#include <QNetworkCookie>".

    I sent a message to so hopefully the patch (along with my patch for qtwebkit) should find their way into GIT soon.

    Other than that, with the approach detailed in my previous post, the build succeeded.

    It took about 4 hours with "make -j 2" on my dual core laptop with both cores running at 1.867 GHz.

  • I had to use "-prefix CD\qtbase" option as described in the qt5 git readme file, to get through the configure step without errors. By not specifying the prefix, my mkspec (win32-msvc2010), was searched in "qtbase\bin" instead in "qtbase".

    In addition i had to install python, because one of the compilation steps had an python call.

    To init the QT Modules I used "git submodule init" and "git submodule update". Are there any magics behind the perl init-submodule script i'm missing (beside submodule selection and git user settings)?

    Actually i'm trying to compile the current git master using Win 7 and VS2010 without success.

    @ cl -c -FIqt_widgets_pch.h -Yuqt_widgets_pch.h -Fptmp\obj\debug_shared\QtWidgetsd_pch.pch -nologo -Zm200 -Zc:wchar_t -Zi -MDd -W3 -w34100 -w341
    AVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -I"....\include\QtCore" -I"....\include\QtCore\5.0.0" -I"....\include\QtCore\5.0.0\QtCore"
    -I"....\include\QtGui\5.0.0" -I"....\include\QtGui\5.0.0\QtGui" -I"....\include\QtGui" -I"....\include" -I"....\include\QtWidgets\5.0.0" -I"....
    \include\QtWidgets\5.0.0\QtWidgets" -I"....\include\QtWidgets" -I"....\include" -I"tmp\rcc\debug_shared" -I"tmp" -I"..\3rdparty\wintab" -I"dialogs"
    -I"..\3rdparty\harfbuzz\src" -I"tmp\moc\debug_shared" -I"." -I"....\mkspecs\win32-msvc2010" -Fotmp\obj\debug_shared\ @C:\Users\vth\AppData\Local\Temp
    c:\qt\5.0\qtbase\include\qtwidgets\5.0.0\qtwidgets\private../../../../../src/widgets/dialogs/qdialog_p.h(61) : fatal error C1083: Datei (Include) kan
    n nicht geöffnet werden: "QtGui/QPlatformDialogHelper": No such file or directory
    NMAKE : fatal error U1077: ""c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.EXE"": Rückgabe-Code "0x2"
    NMAKE : fatal error U1077: ""c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\nmake.exe"": Rückgabe-Code "0x2"
    NMAKE : fatal error U1077: "cd": Rückgabe-Code "0x2"
    NMAKE : fatal error U1077: "cd": Rückgabe-Code "0x2"

    Is there a nightly build process for Qt5 or kind of branch which is stable in the meaning of: at least compilable?

  • Can't configure on ArchLinux x64

    bq. No QPA platform plugin enabled!
    If you really want to build without a QPA platform plugin you must pass
    -no-xcb and -no-wayland to configure. Doing this will produce a Qt that
    cannot run GUI applications.

    But libxcb, mesa and gperf are installed.

    Any suggestions?

  • Add the option -verbose to configure to figure out which test is failing.

    Be sure to install almost all xcb-related packages from your distribution, esp. the ones related to the various X extensions. Double check also their version.

  • Thanks. Verbose helped.

    Here is my installed xcb-package list:

  • Hello again. I have a new error:

    @cd qtsvg/ && make -f Makefile
    make[1]: Entering directory /media/data/Additional/Sources/qt5/qtsvg' /media/data/Additional/Sources/qt5/qtbase/bin/qmake QMAKE_ABSOLUTE_SOURCE_PATH=/media/data/Additional/Sources/qt5/qtbase -o Makefile QMAKESPEC has not been set, so configuration cannot be deduced. Error processing project file: make[1]: *** [Makefile] Error 3 make[1]: Leaving directory/media/data/Additional/Sources/qt5/qtsvg'
    make: *** [module-qtsvg-make_default] Error 2@

    But all other moduls are build well. Error appears after hour of compilation, not at start.

  • Okay it was probably all broken before as i hadn't installed the right prerequisites (the ubuntu 11.10 prerequisite had not been added to the instructions).
    [code]on Ubuntu Oneiric:

    sudo apt-get install libxcb.* libglu1-mesa-dev[/code]

    as oppossed to:
    [code]on Ubuntu/Debian:

    sudo aptitude install ~nlibxcb.*


    I now get this error on compilation:
    [code]In file included from ../3rdparty/freetype/src/autofit/autofit.c:23:0:
    ../3rdparty/freetype/src/autofit/afhints.c: In function ‘af_glyph_hints_reload’:
    ../3rdparty/freetype/src/autofit/afhints.c:642:21: warning: variable ‘first’ set but not used [-Wunused-but-set-variable]
    g++ -c -include .pch/debug-shared/QtPlatformSupport -pipe -g -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W -D_REENTRANT -fPIC -DQT_SHARED -DQT_NO_WAYLAND -DQT_NO_CORESERVICES -DQT_BUILD_PLATFORMSUPPORT_LIB -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_NO_CAST_FROM_ASCII -DQT_COMPILES_IN_HARFBUZZ -DQT_NO_FONTCONFIG -DFT2_BUILD_LIBRARY -DQT_COMPILES_IN_HARFBUZZ -DQT_GUI_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_HAVE_SSE3 -DQT_HAVE_SSSE3 -DQT_HAVE_SSE4_1 -DQT_HAVE_SSE4_2 -DQT_HAVE_AVX -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../mkspecs/linux-g++ -I. -I../../include/QtCore -I../../include/QtCore/5.0.0 -I../../include/QtCore/5.0.0/QtCore -I../../include/QtGui/5.0.0 -I../../include/QtGui/5.0.0/QtGui -I../../include/QtGui -I../../include -I../../include/QtPlatformSupport/5.0.0 -I../../include/QtPlatformSupport/5.0.0/QtPlatformSupport -I../../include/QtPlatformSupport -I../../include -I.rcc/debug-shared -I../3rdparty/harfbuzz/src -I../3rdparty/freetype/builds/unix -I../3rdparty/freetype/src -I../3rdparty/freetype/include -I/usr/X11R6/include -I.moc/debug-shared -o .obj/debug-shared/qglxconvenience.o glxconvenience/qglxconvenience.cpp
    glxconvenience/qglxconvenience.cpp:47:36: fatal error: X11/extensions/Xrender.h: No such file or directory
    compilation terminated.
    make[2]: *** [.obj/debug-shared/qglxconvenience.o] Error 1
    make[2]: *** Waiting for unfinished jobs....
    make[2]: Leaving directory /home/daniel/qt5/qtbase/src/platformsupport' make[1]: *** [sub-platformsupport-make_default-ordered] Error 2 make[1]: Leaving directory/home/daniel/qt5/qtbase'
    make: *** [module-qtbase-make_default] Error 2

    So i was trying to work out what i was missing in terms of dependencies. Considering i installed libglu1-mesa-dev i am not sure.

  • [quote author="werispaul" date="1328263852"]Actually i'm trying to compile the current git master using Win 7 and VS2010 without success.[/quote]
    Finally got it working. In between I've switched from Strawberry Perl to ActivePerl. I'm not sure if it was the crux, but an option to keep in mind (as well as the order of perl in the system PATH, saw the wiki note quite late).

  • Let me join the ranks of people, for whom building Qt5 has failed.

    Using gcc 4.6.2 in Windows 7 x64 environment.

    The last console output before building failed (after spending 3 hours on it :( )

    bq. mingw32-make[3]: Leaving directory C:/Users/Dian/qt5/qtbase/src/widgets' mingw32-make[2]: Leaving directoryC:/Users/Dian/qt5/qtbase/src/widgets'
    cd src\testlib\ && mingw32-make -f Makefile
    mingw32-make[2]: Entering directory C:/Users/Dian/qt5/qtbase/src/testlib' mingw32-make -f Makefile.Debug all mingw32-make[3]: Entering directoryC:/Users/Dian/qt5/qtbase/src/testlib'
    g++ -c -fno-keep-inline-dllexport -g -Wall -frtti -fexceptions -mthreads -DQT_SH
    I"....\include\QtCore" -I"....\include" -I"." -I"....\include\QtTest\5.0.0" -
    I"....\include\QtTest\5.0.0\QtTest" -I"....\include\QtTest" -I"....\include"
    -I"tmp\rcc\debug_shared" -I"tmp" -I"tmp\moc\debug_shared" -I"....\mkspecs\win32
    -g++" -o tmp\obj\debug_shared\qtestcase.o qtestcase.cpp
    qtestcase.cpp:73:21: fatal error: crtdbg.h: No such file or directory
    compilation terminated.
    mingw32-make[3]: *** [tmp/obj/debug_shared/qtestcase.o] Error 1
    mingw32-make[3]: Leaving directory C:/Users/Dian/qt5/qtbase/src/testlib' mingw32-make[2]: *** [debug-all] Error 2 mingw32-make[2]: Leaving directoryC:/Users/Dian/qt5/qtbase/src/testlib'
    mingw32-make[1]: *** [sub-testlib-make_default-ordered] Error 2
    mingw32-make[1]: Leaving directory `C:/Users/Dian/qt5/qtbase'
    mingw32-make: *** [module-qtbase-make_default] Error 2

    Any ideas?
    The missing file I actually do have on my PC, in:
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\crt\src\crtdbg.h
    But what does it have to do with anything, since I am using the GCC toolchain?

    Also, when I configured Qt I used "-nomake tests" - shouldn't that result in skipping qttest?

  • Can someone provide a link for Qt 5 Download??

  • Moderators

    git clone git:// qt5

    "Building Qt5 from Git.":

  • Moderators

    @oneWonders: I just updated the package dependencies on the wiki, hope all are listed now (it's not that often that one has a clean system to start on ;)

    @werispaul: Yes, you need ActiveState perl, and actually also a recent version. But the wiki page already points that out...

    @ddriver: No idea. All I can tell you is that most people developing Qt on Windows are using MSVC compilers (MSVC2008, MSVC2010).

  • Yes, it seems I will have to give it another go using MSVC2010, I am really itching to play a bit with QtQuick 2 :)

    Naturally, after wasting a ton of time the webkit failed, and just to make things even more irritating, when I configure with -no-webkit it says "Unknown option -no-webkit" even thou -no-webkit is listed in the configure options... WTH?

    Also "nmake confclean" doesn't work, returns "NMAKE : fatal error U1073: don't know how to make 'confclean'"

    Also, I tried installing ICU so I can build webkit since the configure utility option doesn't work, and the install procedure for ICU involves files that are not even present in the package.

    I am so very, very angry I hardly contain from beating my hardware, even thou this is all the lousy software's fault...

    I get it that it is free software, prior to final stage, but can it really be that bad? I have build Qt from sources donzes of times and different versions, and it was always effortless.

  • I will add my failure to this thread.

    I managed to compile Qt without too many problems by specifying the -prefix ${ROOT}/qtbase (or -developer-build, to be exact). If I remember correctly, with the -developer-build, I still had some installation issues once qtbase passed. I ended up having to manually run install for each submodule...

    However, when trying to build for the target platform, with -prefix /usr/lib/qt, as I want it on the target, I run into an error once qtbase is built:

    cd qtsvg/ && make -f Makefile
    make[1]: Entering directory /home/pvr/qt5-build-neon/qtsvg' cd src/ && /home/pvr/qt5-build-neon/qtbase/bin/qmake /home/pvr/qt5/qtsvg/src/ QMAKE_ABSOLUTE_SOURCE_PATH=/home/pvr/qt5/qtbase -o Makefile QMAKESPEC has not been set, so configuration cannot be deduced. Error processing project file: /home/pvr/qt5/qtsvg/src/ make[1]: *** [src/Makefile] Error 3 make[1]: Leaving directory/home/pvr/qt5-build-neon/qtsvg'
    make: *** [module-qtsvg-make_default] Error 2

    So I tried exporting QMAKESPEC as the path to my mkspec, but then I get the following error:

    cd svg/ && /home/pvr/qt5-build-neon/qtbase/bin/qmake /home/pvr/qt5/qtsvg/src/svg/
    QMAKE_ABSOLUTE_SOURCE_PATH=/home/pvr/qt5/qtbase -o Makefile
    Project ERROR: Cannot load qmodule.pri!
    make[2]: *** [svg/Makefile] Error 2
    make[2]: Leaving directory /home/pvr/qt5-build-neon/qtsvg/src' make[1]: *** [module-qtsvg-src-make_default] Error 2 make[1]: Leaving directory/home/pvr/qt5-build-neon/qtsvg'
    make: *** [module-qtsvg-make_default] Error 2

    So my question is essentially, is it obligatory to specify the prefix as the path to qtbase? Has anyone else managed to build qt with a different prefix?

    I should add that I am cross-compiling from x86 to an ARM board (iMX515). I built Qt4.8 with no problems previously...

    1. I can't build with different prefix too, MSVC2010SP1.
    2. I can't build QWebkit, I don't know where is the ICU library place?
      Any docs about ICU library installed in Windows?

Log in to reply