Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to compile single Qt module and use it on app?
Forum Updated to NodeBB v4.3 + New Features

How to compile single Qt module and use it on app?

Scheduled Pinned Locked Moved Solved General and Desktop
31 Posts 6 Posters 4.6k Views 3 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.
  • _ _BPL_

    @jsulm said in How to compile single Qt module and use it on app?:

    I would not, because this is not how it should be done.
    You should rebuild this module independently from your app and put it in your Qt installation. Afterwards just build your app as usual.
    Start here: https://wiki.qt.io/Building_Qt_5_from_Git

    I see, let's assume then rebuilding the module independently from the app is the "recommended" way to fix bugs then. Right now I'd like to learn how to build the opengl module so I've tried this:

    (py364_32) C:\Users\KneDa\Desktop\mcve\qtbase\src\opengl>set path=c:\Qt\5.11.3\msvc2015\bin;%path%
    
    (py364_32) C:\Users\KneDa\Desktop\mcve\qtbase\src\opengl>cl
    Microsoft (R) C/C++ Optimizing Compiler Version 19.00.24215.1 for x86
    Copyright (C) Microsoft Corporation.  All rights reserved.
    
    usage: cl [ option... ] filename... [ /link linkoption... ]
    
    (py364_32) C:\Users\KneDa\Desktop\mcve\qtbase\src\opengl>qmake -makefile opengl.pro
    WARNING: Failure to find: \qglfunctions.h
    WARNING: Failure to find: \qglpixelbuffer.h
    WARNING: Failure to find: \qglframebufferobject.h
    WARNING: Failure to find: \qglfunctions.h
    WARNING: Failure to find: \qglpixelbuffer.h
    WARNING: Failure to find: \qglframebufferobject.h
    

    I've tried to meet the requirements of the page you've posted so I'm having {python3.6.x, perl 5.26 (cygwin version), vs2015_x86 env vars available} but as you can see is giving me warnings, any idea how to fix this?

    Also, as you can see I've decided trying to build qtbase\src\opengl\opengl.pro is the library used when you've got the directive QT+=opengl but just to be sure, how do you know what are the corresponding .pro files for these directives?

    PS: I've tried to build it and I'll get a bunch of errors:

    jom 1.1.3 - empower your cores
    
        D:\software\jom\jom.exe -f Makefile.Release
        cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -O2 -Zi -MD -utf-8 /wd4530 /wd4577 -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 /Fd.obj\release\opengl.vc.pdb -DUNICODE -D_UNICODE -DWIN32 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DQT_DEPRECATED_WARNINGS -DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DNDEBUG -I. -I. -IC:\Qt\5.11.3\msvc2015\include -IC:\Qt\5.11.3\msvc2015\include\QtGui -IC:\Qt\5.11.3\msvc2015\include\QtANGLE -IC:\Qt\5.11.3\msvc2015\include\QtCore -I.moc\release -I\include -IC:\opensslx86\include -IC:\Utils\my_sql\mysql-5.6.11-win32\include -IC:\Utils\postgresqlx86\pgsql\include -I..\..\mkspecs\win32-msvc -Fo.obj\release\ @C:\Users\KneDa\AppData\Local\Temp\qgl.obj.4636.31.jom
    qgl.cpp
    qgl.cpp(40): fatal error C1083: Cannot open include file: 'qapplication.h': No such file or directory
    jom: C:\Users\KneDa\Desktop\mcve\qtbase\src\opengl\Makefile.Release [.obj\release\qgl.obj] Error 2
        cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -O2 -Zi -MD -utf-8 /wd4530 /wd4577 -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 /Fd.obj\release\opengl.vc.pdb -DUNICODE -D_UNICODE -DWIN32 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DQT_DEPRECATED_WARNINGS -DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DNDEBUG -I. -I. -IC:\Qt\5.11.3\msvc2015\include -IC:\Qt\5.11.3\msvc2015\include\QtGui -IC:\Qt\5.11.3\msvc2015\include\QtANGLE -IC:\Qt\5.11.3\msvc2015\include\QtCore -I.moc\release -I\include -IC:\opensslx86\include -IC:\Utils\my_sql\mysql-5.6.11-win32\include -IC:\Utils\postgresqlx86\pgsql\include -I..\..\mkspecs\win32-msvc -Fo.obj\release\ @C:\Users\KneDa\AppData\Local\Temp\qglbuffer.obj.4636.31.jom
    qglbuffer.cpp
        cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -O2 -Zi -MD -utf-8 /wd4530 /wd4577 -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 /Fd.obj\release\opengl.vc.pdb -DUNICODE -D_UNICODE -DWIN32 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DQT_DEPRECATED_WARNINGS -DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DNDEBUG -I. -I. -IC:\Qt\5.11.3\msvc2015\include -IC:\Qt\5.11.3\msvc2015\include\QtGui -IC:\Qt\5.11.3\msvc2015\include\QtANGLE -IC:\Qt\5.11.3\msvc2015\include\QtCore -I.moc\release -I\include -IC:\opensslx86\include -IC:\Utils\my_sql\mysql-5.6.11-win32\include -IC:\Utils\postgresqlx86\pgsql\include -I..\..\mkspecs\win32-msvc -Fo.obj\release\ @C:\Users\KneDa\AppData\Local\Temp\qglcolormap.obj.4636.31.jom
    qglcolormap.cpp
        cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -O2 -Zi -MD -utf-8 /wd4530 /wd4577 -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 /Fd.obj\release\opengl.vc.pdb -DUNICODE -D_UNICODE -DWIN32 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DQT_DEPRECATED_WARNINGS -DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DNDEBUG -I. -I. -IC:\Qt\5.11.3\msvc2015\include -IC:\Qt\5.11.3\msvc2015\include\QtGui -IC:\Qt\5.11.3\msvc2015\include\QtANGLE -IC:\Qt\5.11.3\msvc2015\include\QtCore -I.moc\release -I\include -IC:\opensslx86\include -IC:\Utils\my_sql\mysql-5.6.11-win32\include -IC:\Utils\postgresqlx86\pgsql\include -I..\..\mkspecs\win32-msvc -Fo.obj\release\ @C:\Users\KneDa\AppData\Local\Temp\qglframebufferobject.obj.4636.46.jom
    qglframebufferobject.cpp
        cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -O2 -Zi -MD -utf-8 /wd4530 /wd4577 -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 /Fd.obj\release\opengl.vc.pdb -DUNICODE -D_UNICODE -DWIN32 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DQT_DEPRECATED_WARNINGS -DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DNDEBUG -I. -I. -IC:\Qt\5.11.3\msvc2015\include -IC:\Qt\5.11.3\msvc2015\include\QtGui -IC:\Qt\5.11.3\msvc2015\include\QtANGLE -IC:\Qt\5.11.3\msvc2015\include\QtCore -I.moc\release -I\include -IC:\opensslx86\include -IC:\Utils\my_sql\mysql-5.6.11-win32\include -IC:\Utils\postgresqlx86\pgsql\include -I..\..\mkspecs\win32-msvc -Fo.obj\release\ @C:\Users\KneDa\AppData\Local\Temp\qglfunctions.obj.4636.46.jom
    qglfunctions.cpp
        cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -O2 -Zi -MD -utf-8 /wd4530 /wd4577 -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 /Fd.obj\release\opengl.vc.pdb -DUNICODE -D_UNICODE -DWIN32 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DQT_DEPRECATED_WARNINGS -DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DNDEBUG -I. -I. -IC:\Qt\5.11.3\msvc2015\include -IC:\Qt\5.11.3\msvc2015\include\QtGui -IC:\Qt\5.11.3\msvc2015\include\QtANGLE -IC:\Qt\5.11.3\msvc2015\include\QtCore -I.moc\release -I\include -IC:\opensslx86\include -IC:\Utils\my_sql\mysql-5.6.11-win32\include -IC:\Utils\postgresqlx86\pgsql\include -I..\..\mkspecs\win32-msvc -Fo.obj\release\ @C:\Users\KneDa\AppData\Local\Temp\qglpaintdevice.obj.4636.46.jom
    qglpaintdevice.cpp
        cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -O2 -Zi -MD -utf-8 /wd4530 /wd4577 -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 /Fd.obj\release\opengl.vc.pdb -DUNICODE -D_UNICODE -DWIN32 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DQT_DEPRECATED_WARNINGS -DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DNDEBUG -I. -I. -IC:\Qt\5.11.3\msvc2015\include -IC:\Qt\5.11.3\msvc2015\include\QtGui -IC:\Qt\5.11.3\msvc2015\include\QtANGLE -IC:\Qt\5.11.3\msvc2015\include\QtCore -I.moc\release -I\include -IC:\opensslx86\include -IC:\Utils\my_sql\mysql-5.6.11-win32\include -IC:\Utils\postgresqlx86\pgsql\include -I..\..\mkspecs\win32-msvc -Fo.obj\release\ @C:\Users\KneDa\AppData\Local\Temp\qglpixelbuffer.obj.4636.46.jom
    qglpixelbuffer.cpp
        cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -O2 -Zi -MD -utf-8 /wd4530 /wd4577 -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 /Fd.obj\release\opengl.vc.pdb -DUNICODE -D_UNICODE -DWIN32 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DQT_DEPRECATED_WARNINGS -DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DNDEBUG -I. -I. -IC:\Qt\5.11.3\msvc2015\include -IC:\Qt\5.11.3\msvc2015\include\QtGui -IC:\Qt\5.11.3\msvc2015\include\QtANGLE -IC:\Qt\5.11.3\msvc2015\include\QtCore -I.moc\release -I\include -IC:\opensslx86\include -IC:\Utils\my_sql\mysql-5.6.11-win32\include -IC:\Utils\postgresqlx86\pgsql\include -I..\..\mkspecs\win32-msvc -Fo.obj\release\ @C:\Users\KneDa\AppData\Local\Temp\qglshaderprogram.obj.4636.62.jom
    qglshaderprogram.cpp
    qglpixelbuffer.cpp(92): fatal error C1083: Cannot open include file: 'private/qopenglextensions_p.h': No such file or directory
    jom: C:\Users\KneDa\Desktop\mcve\qtbase\src\opengl\Makefile.Release [.obj\release\qglpixelbuffer.obj] Error 2
    qglpaintdevice.cpp(40): fatal error C1083: Cannot open include file: 'private/qglpaintdevice_p.h': No such file or directory
    jom: C:\Users\KneDa\Desktop\mcve\qtbase\src\opengl\Makefile.Release [.obj\release\qglpaintdevice.obj] Error 2
    qglcolormap.cpp(96): warning C4273: 'shared_null': inconsistent dll linkage
    c:\users\kneda\desktop\mcve\qtbase\src\opengl\qglcolormap.h(83): note: see previous definition of 'private: static QGLColormap::QGLColormapData QGLColormap::shared_null'
    qglcolormap.cpp(96): error C2491: 'QGLColormap::shared_null': definition of dllimport static data member not allowed
    qglcolormap.cpp(102): warning C4273: 'QGLColormap::QGLColormap': inconsistent dll linkage
    c:\users\kneda\desktop\mcve\qtbase\src\opengl\qglcolormap.h(53): note: see previous definition of '{ctor}'
    qglcolormap.cpp(112): warning C4273: 'QGLColormap::QGLColormap': inconsistent dll linkage
    c:\users\kneda\desktop\mcve\qtbase\src\opengl\qglcolormap.h(54): note: see previous definition of '{ctor}'
    qglcolormap.cpp(122): warning C4273: 'QGLColormap::~QGLColormap': inconsistent dll linkage
    c:\users\kneda\desktop\mcve\qtbase\src\opengl\qglcolormap.h(55): note: see previous definition of '{dtor}'
    qglcolormap.cpp(128): warning C4273: 'QGLColormap::cleanup': inconsistent dll linkage
    c:\users\kneda\desktop\mcve\qtbase\src\opengl\qglcolormap.h(84): note: see previous definition of 'cleanup'
    qglcolormap.cpp(138): warning C4273: 'QGLColormap::operator =': inconsistent dll linkage
    c:\users\kneda\desktop\mcve\qtbase\src\opengl\qglcolormap.h(57): note: see previous definition of '='
    qglcolormap.cpp(154): warning C4273: 'QGLColormap::detach_helper': inconsistent dll linkage
    c:\users\kneda\desktop\mcve\qtbase\src\opengl\qglcolormap.h(85): note: see previous definition of 'detach_helper'
    qglcolormap.cpp(172): warning C4273: 'QGLColormap::setEntry': inconsistent dll linkage
    c:\users\kneda\desktop\mcve\qtbase\src\opengl\qglcolormap.h(64): note: see previous definition of 'setEntry'
    qglcolormap.cpp(186): warning C4273: 'QGLColormap::setEntries': inconsistent dll linkage
    c:\users\kneda\desktop\mcve\qtbase\src\opengl\qglcolormap.h(63): note: see previous definition of 'setEntries'
    qglcolormap.cpp(201): warning C4273: 'QGLColormap::entryRgb': inconsistent dll linkage
    c:\users\kneda\desktop\mcve\qtbase\src\opengl\qglcolormap.h(66): note: see previous definition of 'entryRgb'
    qglcolormap.cpp(214): warning C4273: 'QGLColormap::setEntry': inconsistent dll linkage
    c:\users\kneda\desktop\mcve\qtbase\src\opengl\qglcolormap.h(65): note: see previous definition of 'setEntry'
    qglcolormap.cpp(222): warning C4273: 'QGLColormap::entryColor': inconsistent dll linkage
    c:\users\kneda\desktop\mcve\qtbase\src\opengl\qglcolormap.h(67): note: see previous definition of 'entryColor'
    qglcolormap.cpp(243): warning C4273: 'QGLColormap::isEmpty': inconsistent dll linkage
    c:\users\kneda\desktop\mcve\qtbase\src\opengl\qglcolormap.h(59): note: see previous definition of 'isEmpty'
    qglcolormap.cpp(252): warning C4273: 'QGLColormap::size': inconsistent dll linkage
    c:\users\kneda\desktop\mcve\qtbase\src\opengl\qglcolormap.h(60): note: see previous definition of 'size'
    qglcolormap.cpp(261): warning C4273: 'QGLColormap::find': inconsistent dll linkage
    c:\users\kneda\desktop\mcve\qtbase\src\opengl\qglcolormap.h(68): note: see previous definition of 'find'
    qglcolormap.cpp(272): warning C4273: 'QGLColormap::findNearest': inconsistent dll linkage
    c:\users\kneda\desktop\mcve\qtbase\src\opengl\qglcolormap.h(69): note: see previous definition of 'findNearest'
    jom: C:\Users\KneDa\Desktop\mcve\qtbase\src\opengl\Makefile.Release [.obj\release\qglcolormap.obj] Error 2
    qglbuffer.cpp(41): fatal error C1083: Cannot open include file: 'QtOpenGL/private/qgl_p.h': No such file or directory
    jom: C:\Users\KneDa\Desktop\mcve\qtbase\src\opengl\Makefile.Release [.obj\release\qglbuffer.obj] Error 2
    c:\users\kneda\desktop\mcve\qtbase\src\opengl\qglframebufferobject_p.h(55): fatal error C1083: Cannot open include file: 'private/qglpaintdevice_p.h': No such file or directory
    jom: C:\Users\KneDa\Desktop\mcve\qtbase\src\opengl\Makefile.Release [.obj\release\qglframebufferobject.obj] Error 2
    qglshaderprogram.cpp(41): fatal error C1083: Cannot open include file: 'private/qopenglextensions_p.h': No such file or directory
    jom: C:\Users\KneDa\Desktop\mcve\qtbase\src\opengl\Makefile.Release [.obj\release\qglshaderprogram.obj] Error 2
    c:\users\kneda\desktop\mcve\qtbase\src\opengl\qgl_p.h(61): fatal error C1083: Cannot open include file: 'QtWidgets/private/qwidget_p.h': No such file or directory
    jom: C:\Users\KneDa\Desktop\mcve\qtbase\src\opengl\Makefile.Release [.obj\release\qglfunctions.obj] Error 2
    jom: C:\Users\KneDa\Desktop\mcve\qtbase\src\opengl\Makefile [release] Error 2
    
    jsulmJ Offline
    jsulmJ Offline
    jsulm
    Lifetime Qt Champion
    wrote on last edited by
    #4

    @_BPL_ said in How to compile single Qt module and use it on app?:

    how do you know what are the corresponding .pro files for these directives?

    It's mentioned in Qt documentation: for example see https://doc.qt.io/qt-5/qglwidget.html "qmake: QT += opengl".

    I don't think you can just build opengl part of qtbase, you need to build the whole qtbase.

    https://forum.qt.io/topic/113070/qt-code-of-conduct

    1 Reply Last reply
    0
    • _ Offline
      _ Offline
      _BPL_
      wrote on last edited by
      #5
      (py364_32) C:\Users\KneDa\Desktop\mcve\qtbase\src\opengl>where qmake
      C:\Users\KneDa\Desktop\mcve\qtbase\bin\qmake.exe
      
      (py364_32) C:\Users\KneDa\Desktop\mcve\qtbase\src\opengl>qmake -makefile opengl.pro
      Project ERROR: Could not find feature opengl.
      

      what does this mean?

      @jsulm said in How to compile single Qt module and use it on app?:

      I don't think you can just build opengl part of qtbase, you need to build the whole qtbase.

      How long would this take? Would that mean to build all qt modules? Last time I've built qt was few months ago and the process would take few hours...

      Btw, when I run configure.bat I'll get this strange message

      Qt is now configured for building. Just run 'jom'.
      Once everything is built, you must run 'jom install'.
      Qt will be installed into 'C:\Qt\Qt-5.12.4'.
      

      Why is that? My active branch is 5.12, that message lives here https://github.com/qt/qtbase/blob/5.12/mkspecs/features/qt_configure.prf#L2510-L2513, why does it say 5-12.4?

      jsulmJ 1 Reply Last reply
      0
      • _ _BPL_
        (py364_32) C:\Users\KneDa\Desktop\mcve\qtbase\src\opengl>where qmake
        C:\Users\KneDa\Desktop\mcve\qtbase\bin\qmake.exe
        
        (py364_32) C:\Users\KneDa\Desktop\mcve\qtbase\src\opengl>qmake -makefile opengl.pro
        Project ERROR: Could not find feature opengl.
        

        what does this mean?

        @jsulm said in How to compile single Qt module and use it on app?:

        I don't think you can just build opengl part of qtbase, you need to build the whole qtbase.

        How long would this take? Would that mean to build all qt modules? Last time I've built qt was few months ago and the process would take few hours...

        Btw, when I run configure.bat I'll get this strange message

        Qt is now configured for building. Just run 'jom'.
        Once everything is built, you must run 'jom install'.
        Qt will be installed into 'C:\Qt\Qt-5.12.4'.
        

        Why is that? My active branch is 5.12, that message lives here https://github.com/qt/qtbase/blob/5.12/mkspecs/features/qt_configure.prf#L2510-L2513, why does it say 5-12.4?

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #6

        @_BPL_ said in How to compile single Qt module and use it on app?:

        why does it say 5-12.4?

        I guess because the current version in 5.12 branch is 5.12.4?

        "How long would this take? Would that mean to build all qt modules?" - only qtbase module. How long it will take depends on your machine, but should not take very long.

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        _ 1 Reply Last reply
        2
        • jsulmJ jsulm

          @_BPL_ said in How to compile single Qt module and use it on app?:

          why does it say 5-12.4?

          I guess because the current version in 5.12 branch is 5.12.4?

          "How long would this take? Would that mean to build all qt modules?" - only qtbase module. How long it will take depends on your machine, but should not take very long.

          _ Offline
          _ Offline
          _BPL_
          wrote on last edited by
          #7

          @jsulm Just to be clear, what are the steps to build qtbase? Only thing it seemed to work was building all (ie: default target) but that would take hours.

          jsulmJ 1 Reply Last reply
          0
          • _ _BPL_

            @jsulm Just to be clear, what are the steps to build qtbase? Only thing it seemed to work was building all (ie: default target) but that would take hours.

            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #8

            @_BPL_ said in How to compile single Qt module and use it on app?:

            what are the steps to build qtbase?

            In Qt source code tree go to qtbase and do

            configure
            make
            make install
            

            Or jom instead of make if you're using Microsoft compiler.

            If you need an exact version then check out the proper tag (like for example https://github.com/qt/qtbase/tree/v5.12.3).

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            2
            • _ Offline
              _ Offline
              _BPL_
              wrote on last edited by
              #9

              @jsulm I see, so your suggestion is basically using the default target, which means I'd have to compile a lot of stuff I won't need to find the underlying issue of the bug... that's exactly what I wanted to avoid in the first place, for instance, if you do:

              git clone https://github.com/qt/qtbase
              cd qtbase
              git checkout -b 5.12.3 --track origin/5.12.3
              configure.bat -prefix "d:/qt/5.12.3" -opensource -confirm-license -nomake examples -nomake tests
              jom
              jom install
              

              That cold build would take me probably few hours.

              Another thing I've tried was disabling all available-features (which I've got by using configure.bat -list-features), that would
              end up giving errors though.

              In any case, my question still remains. I just want to learn how to build a single module from sources without having to compile any unnecesary stuff, I've seen there is some config tool but that's only available in the commercial version.

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #10

                Hi,

                The qtbase module is some kind of an exception. It provides all the infrastructure needed for the other modules.

                For all the others you can build them one by one.

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                JKSHJ 1 Reply Last reply
                1
                • SGaistS SGaist

                  Hi,

                  The qtbase module is some kind of an exception. It provides all the infrastructure needed for the other modules.

                  For all the others you can build them one by one.

                  JKSHJ Offline
                  JKSHJ Offline
                  JKSH
                  Moderators
                  wrote on last edited by
                  #11

                  @_BPL_ said in How to compile single Qt module and use it on app?:

                  I just want to learn how to build a single module from sources without having to compile any unnecesary stuff

                  You can learn by practicing on a smaller, simpler module. Try building the Qt SVG module, for example.

                  find the underlying issue of the bug

                  Note that QTBUG-74492 talks about a bug in Qt Quick. Qt Quick does not use the Qt OpenGL module!

                  The Qt OpenGL module contains old widgets for rendering OpenGL, like QGLWidget. This module has been deprecated in favour of newer OpenGL classes and methods within the Qt GUI module

                  @SGaist said in How to compile single Qt module and use it on app?:

                  The qtbase module is some kind of an exception. It provides all the infrastructure needed for the other modules.

                  To be clear, qtbase.git is a repository that contains several modules.

                  See https://wiki.qt.io/Qt_5_Structure (it's outdated, but it shows the idea)

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

                  1 Reply Last reply
                  1
                  • _ Offline
                    _ Offline
                    _BPL_
                    wrote on last edited by
                    #12

                    @SGaist @JKSH

                    Hi guys, today I've been all day long getting familiar about building qt from sources. Right now I've found a way to configure qtbase that's giving me a 20min cold build using jom in my old laptop .Then I just can rebuild individual modules in few seconds (warm builds) by cding in the module directories and run nmake or jom.

                    That said, I've also making a little bit of bug hanting... you can read my last comment here asking for help to Qt devs.

                    In any case, I'd like to know something which it's actually related to another question I've done here https://forum.qt.io/topic/104426/how-to-build-efficiently-different-qt-versions-from-sources.

                    Right now I know the bug 74492 isn't living in version 5.11.2 but it's living in version 5.11.3! So, let's say I'd like to use some binary search where I'll recompile and test intermediate commits in this range... obviously you wouldn't use something like git checkout -- . && git clean -fxd each time you checkout a new possible commit... otherwise you'd need to do cold builds all the time... but the question here is. Is it safe to configure after you've checked out a new qtbase commit and rebuilding?

                    Asking cos once you run configure.bat it warns about:

                    Prior to reconfiguration, make sure you remove any leftovers from
                    the previous build.
                    

                    Hopefully you can advice, btw, are you guys Qt devs?

                    Thanks in advance :)

                    JKSHJ 1 Reply Last reply
                    0
                    • _ _BPL_

                      @SGaist @JKSH

                      Hi guys, today I've been all day long getting familiar about building qt from sources. Right now I've found a way to configure qtbase that's giving me a 20min cold build using jom in my old laptop .Then I just can rebuild individual modules in few seconds (warm builds) by cding in the module directories and run nmake or jom.

                      That said, I've also making a little bit of bug hanting... you can read my last comment here asking for help to Qt devs.

                      In any case, I'd like to know something which it's actually related to another question I've done here https://forum.qt.io/topic/104426/how-to-build-efficiently-different-qt-versions-from-sources.

                      Right now I know the bug 74492 isn't living in version 5.11.2 but it's living in version 5.11.3! So, let's say I'd like to use some binary search where I'll recompile and test intermediate commits in this range... obviously you wouldn't use something like git checkout -- . && git clean -fxd each time you checkout a new possible commit... otherwise you'd need to do cold builds all the time... but the question here is. Is it safe to configure after you've checked out a new qtbase commit and rebuilding?

                      Asking cos once you run configure.bat it warns about:

                      Prior to reconfiguration, make sure you remove any leftovers from
                      the previous build.
                      

                      Hopefully you can advice, btw, are you guys Qt devs?

                      Thanks in advance :)

                      JKSHJ Offline
                      JKSHJ Offline
                      JKSH
                      Moderators
                      wrote on last edited by
                      #13

                      @_BPL_ said in How to compile single Qt module and use it on app?:

                      Right now I know the bug 74492 isn't living in version 5.11.2 but it's living in version 5.11.3!

                      Good work; this information should help identify the issue.

                      In any case, I'd like to know something which it's actually related to another question I've done here https://forum.qt.io/topic/104426/how-to-build-efficiently-different-qt-versions-from-sources.

                      ...

                      So, let's say I'd like to use some binary search where I'll recompile and test intermediate commits in this range... obviously you wouldn't use something like git checkout -- . && git clean -fxd each time you checkout a new possible commit... otherwise you'd need to do cold builds all the time... but the question here is. Is it safe to configure after you've checked out a new qtbase commit and rebuilding?

                      Ok, so you want to do a git-bisect. Someone did that at https://bugreports.qt.io/browse/QTBUG-73715

                      I've never done this on Qt itself before, so I don't know what's the correct/safe way to do it.

                      are you guys Qt devs?

                      None of us who have replied here work for the Qt Company; we're just Qt "users". You can find Qt devs at the Development mailing list: https://lists.qt-project.org/listinfo/development (subscribe first, then you can post there)

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

                      _ 1 Reply Last reply
                      2
                      • JKSHJ JKSH

                        @_BPL_ said in How to compile single Qt module and use it on app?:

                        Right now I know the bug 74492 isn't living in version 5.11.2 but it's living in version 5.11.3!

                        Good work; this information should help identify the issue.

                        In any case, I'd like to know something which it's actually related to another question I've done here https://forum.qt.io/topic/104426/how-to-build-efficiently-different-qt-versions-from-sources.

                        ...

                        So, let's say I'd like to use some binary search where I'll recompile and test intermediate commits in this range... obviously you wouldn't use something like git checkout -- . && git clean -fxd each time you checkout a new possible commit... otherwise you'd need to do cold builds all the time... but the question here is. Is it safe to configure after you've checked out a new qtbase commit and rebuilding?

                        Ok, so you want to do a git-bisect. Someone did that at https://bugreports.qt.io/browse/QTBUG-73715

                        I've never done this on Qt itself before, so I don't know what's the correct/safe way to do it.

                        are you guys Qt devs?

                        None of us who have replied here work for the Qt Company; we're just Qt "users". You can find Qt devs at the Development mailing list: https://lists.qt-project.org/listinfo/development (subscribe first, then you can post there)

                        _ Offline
                        _ Offline
                        _BPL_
                        wrote on last edited by
                        #14

                        @JKSH said in How to compile single Qt module and use it on app?:

                        Ok, so you want to do a git-bisect. Someone did that at https://bugreports.qt.io/browse/QTBUG-73715
                        I've never done this on Qt itself before, so I don't know what's the correct/safe way to do it.

                        Probably... if this project was as easy changing the commit + press 1 button and getting a fresh build I'd try that straightaway. Problem is a cold build right now is ~20min and If I switch to another commit and I reconfigure it (without cleaning) I'll get errors so I need to be careful with the test strategy :/ . Right now I've built v5.11.2 using a prefix of "d:/qt/5.11.2" and I've figured out all candidate commits that have potentially introduced the bug:

                        08de243eaa (tag: v5.11.3, 5.11.3) Add changes file for Qt 5.11.3                                      
                        c05080102f tst_QNetworkReply: Blacklist getFromHttp:success-external                                  
                        c69f43594f Merge 5.11 into 5.11.3                                                                     
                        9137691e74 Windows QPA: Fix crash showing QSystemTrayIcon's context menu with PROCESS_DPI_UNAWARE     
                        dec7961709 QSyntaxHighlighter: Delay all highlights until first rehighlight                           
                        bdebc90c28 Bump version                                                                               
                        38b87cc4bb Doc: Clarify what samples() returns if not explicitly set                                  
                        9933511838 Fix typo in define. s/GL_FRAMEBUFFER_SRB/GL_FRAMEBUFFER_SRGB                               
                        825f988156 Modernize the "textcodec" feature                                                          
                        b5d249f953 Update the floppy disk icon (save) to be physically correct                                
                        9f2216667a Fix memory copy in QGIFFormat::disposePrevious()                                           
                        033cc3403a mkspecs: use cross compile tools with LTCG                                                 
                        67c66c4ea4 windows: Give up on SwitchableComposition                                                  
                        c9d18d4a9c eglfs_kms: initialize m_deviceListener                                                     
                        1b9af84c1b Don't create an offscreen surface when not on the GUI thread                               
                        3b8075de3b Fix deleting of QSharedPointer internals in case QPointer loses the race                   
                        d4e937a628 xcb: Don't get initial screen rotation                                                     
                        d2e0e416d4 Fix leaking QTabletEventPrivate instance                                                   
                        38afa46c47 macOS: Only detect changes to the SDK version within the same developer dir                
                        509d566ec0 Don't block mouse events if the window is a Tooltip type                                   
                        72bedd49bf [cocoa] Disable offline renderers for dual AMD FirePro GPU                                 
                        0cb44e2cfb Fix stylesheet example for QLineEdit:read-only code example                                
                        2708c6c11d OpenSSL: force the "1.0.0" soname when loading OpenSSL 1.0                                 
                        948f8ce2ec QWinEventNotifier: fix crash on application shutdown                                       
                        44eeeb8e81 Upgrade PCRE2 to 10.32                                                                     
                        6599c1f758 QPicture: fix crash for malformed picture                                                  
                        7f60940fbe Re-disable statx() on Android                                                              
                        2624676b57 qmake: Remove the extra space before -MT                                                   
                        1cd2955173 Fix enum passed to QFontDatabase::findFont                                                 
                        fc4b0769a5 Fix pdf printing in static builds                                                          
                        b7887f9b4f Linux: Remove our use of syscall() for statx(2) and renameat2(2)                           
                        3eebadc173 Modernize the "mimetype" feature                                                           
                        9c8ca26a48 Modernize the "codecs" feature                                                             
                        4e7b58629a Modernize the "big_codecs" feature                                                         
                        c593492d16 Modernize the "animation" feature                                                          
                        0509383cf2 Bump copyright year in executable metadata                                                 
                        0d7c049e44 Update bundled libpng to version 1.6.35                                                    
                        dc5f9d0c31 Only use a translucent background if there is support for alpha                            
                        091a386eaf Use native visual ID when creating GBM surfaces for KMS                                    
                        4dc251879c Ssl: Fix contrived crash when calling resume                                               
                        ba0ff45109 Update the DNS public suffix list from publicsuffix.org                                    
                        836a2fb887 [macOS] Fix position of sheets when using unifiedTitleAndToolBarOnMac                      
                        7146c9075c Fix DejaVu fonts URL                                                                       
                        92f42caff1 Fix ICE on QNX 6.6                                                                         
                        04aeffbe8f Doc: Describe behavior of QSslConfiguration::caCertificates() on iOS                       
                        18ec0a8b09 Windows QPA: Fix WM_NCHITTEST not being sent to QAbstractNativeEventFilter                 
                        d8817ddde6 Use update() instead of repaint() when displaying a new message                            
                        ced34cb3d5 QDateTimeParser: avoid using an invalid hour by default                                    
                        5a295a1009 Scale seconds by a thousand to get milliseconds                                            
                        c958fb8b48 zlib: Fix spelling of license                                                              
                        b2b32d3147 fix HTML subset documentation is not very readable on smaller screens                      
                        caa598c843 Fix QUrl::matches for when removing authority parts (other than host)                      
                        94884246d4 QCommandLineParser: Ensure that an option text ends with a newline                         
                        ef4ba0285f SSL: Don't write to closed socket or write to deallocated buffer                           
                        3ed8dc3788 Android: fix log output pattern                                                            
                        857a0d4c51 Fix the /J option for MSVC project generation                                              
                        555a6b5d5d Modernize the "filesystemwatcher" feature                                                  
                        5e64957ee4 Fix QCompleter popups preventing the application from exiting                              
                        f99e956d65 Add QT_REQUIRE_CONFIG(ssl) to pre-shared key authenticator                                 
                        02663718a9 QHeaderView: Don't unhide hidden sections on layoutChanged()                               
                        b26cd68bf6 Modernize the "datestring" feature                                                         
                        e226b0f94a Modernize the "textdate" feature                                                           
                        6948bf20a7 QSslContext: Use 0 instead of TLS_MAX_VERSION                                              
                        4b7ff8e98c Protect HSTS code for no-feature-settings build                                            
                        4fc4f7b0ce Export qt_open64 from QtCore                                                               
                        8aa9bb6d3f Clarify docs regarding the states of a QFutureWatcher with no future set                   
                        12c357bebb Document IAccessible2 version                                                              
                        cb5c24fa26 Fix integer overflow in very long sections in ELF objects                                  
                        1511bfef52 Disable RGB64 backend for ARGB32 when it will be very slow                                 
                        6af8b5e791 Merge remote-tracking branch 'origin/5.11.2' into 5.11                                     
                        49efea26a5 sqlite: Fix QSqlError handling when opening/closing database                               
                        45c1473847 Detect when we are at the sentence boundary                                                
                        b0dce506cc (HEAD -> 5.11.2, tag: v5.11.2) add buildsystem+qmake changelog       
                        

                        Problem is I'm not sure what's the safest way to test them out without spawning a cold build on each new test :/ . I'm using visual studio compiler and I haven't found any "standard" alternative to ccache, just a bunch of github projects that looked kind of experimental.

                        In any case, you can see there are 73 commits over there to check and in the worst case scenario would be 73*20min if
                        cleaning before building, that's nuts and I definitely won't go down that path :)

                        1 Reply Last reply
                        0
                        • Christian EhrlicherC Online
                          Christian EhrlicherC Online
                          Christian Ehrlicher
                          Lifetime Qt Champion
                          wrote on last edited by
                          #15

                          @_BPL_ said in How to compile single Qt module and use it on app?:

                          In any case, you can see there are 73 commits over there

                          No, not 73 - max. 7 - see git bisect

                          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                          Visit the Qt Academy at https://academy.qt.io/catalog

                          1 Reply Last reply
                          2
                          • _ Offline
                            _ Offline
                            _BPL_
                            wrote on last edited by
                            #16

                            @Christian-Ehrlicher said in How to compile single Qt module and use it on app?:

                            No, not 73 - max. 7 - see git bisect

                            Mmmm, interesting command indeed, it uses binary search... guess that 7 comes from ceil(log2(73))? Worst case of 7*20 isn't that bad (I guess :P)... I'll get familiar with that command first using some dummy projects for not screwing up with the real thing.

                            In any case, it'd be interesting to know what's the workflow used by qt developers, which I'm pretty much sure it'll be quite optimized so they can check different versions relatively fast.

                            JKSHJ 1 Reply Last reply
                            0
                            • _ _BPL_

                              @Christian-Ehrlicher said in How to compile single Qt module and use it on app?:

                              No, not 73 - max. 7 - see git bisect

                              Mmmm, interesting command indeed, it uses binary search... guess that 7 comes from ceil(log2(73))? Worst case of 7*20 isn't that bad (I guess :P)... I'll get familiar with that command first using some dummy projects for not screwing up with the real thing.

                              In any case, it'd be interesting to know what's the workflow used by qt developers, which I'm pretty much sure it'll be quite optimized so they can check different versions relatively fast.

                              JKSHJ Offline
                              JKSHJ Offline
                              JKSH
                              Moderators
                              wrote on last edited by
                              #17

                              @_BPL_ said in How to compile single Qt module and use it on app?:

                              Mmmm, interesting command indeed, it uses binary search... guess that 7 comes from ceil(log2(73))? Worst case of 7*20 isn't that bad (I guess :P)... I'll get familiar with that command first using some dummy projects for not screwing up with the real thing.

                              In any case, it'd be interesting to know what's the workflow used by qt developers, which I'm pretty much sure it'll be quite optimized so they can check different versions relatively fast.

                              See my previous post. It contains a link to an example where someone used git-bisect to hunt down a Qt bug. It also contains a link to the Developer mailing list where you can talk to the Qt developers directly.

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

                              _ 1 Reply Last reply
                              2
                              • JKSHJ JKSH

                                @_BPL_ said in How to compile single Qt module and use it on app?:

                                Mmmm, interesting command indeed, it uses binary search... guess that 7 comes from ceil(log2(73))? Worst case of 7*20 isn't that bad (I guess :P)... I'll get familiar with that command first using some dummy projects for not screwing up with the real thing.

                                In any case, it'd be interesting to know what's the workflow used by qt developers, which I'm pretty much sure it'll be quite optimized so they can check different versions relatively fast.

                                See my previous post. It contains a link to an example where someone used git-bisect to hunt down a Qt bug. It also contains a link to the Developer mailing list where you can talk to the Qt developers directly.

                                _ Offline
                                _ Offline
                                _BPL_
                                wrote on last edited by
                                #18

                                @JKSH said in How to compile single Qt module and use it on app?:

                                See my previous post. It contains a link to an example where someone used git-bisect to hunt down a Qt bug. It also contains a link to the Developer mailing list where you can talk to the Qt developers directly.

                                Thanks, but... I've decided to ask to one of the devs... It'd be great if git-bisect could be used effectively on windows+visual_studio although my hopes are quite low.

                                The closes I've been to avoid doing git checkout -- . && git clean -fxd was to checkout a possible bad commit, cd qmake && nmake clean and configure.bat <options>... in this case configure.bat wouldn't give me errors... but when building again qtbase times would still be as similar as a cold build :(

                                1 Reply Last reply
                                0
                                • Christian EhrlicherC Online
                                  Christian EhrlicherC Online
                                  Christian Ehrlicher
                                  Lifetime Qt Champion
                                  wrote on last edited by Christian Ehrlicher
                                  #19

                                  Why not simply using git-bisect on the command line and compile without any make clean before? I don't see any need to call configure.bat again - nothing configure specific will change inbetween those 72 commits in a stable branch - and if you will notice it during compilation.

                                  Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                                  Visit the Qt Academy at https://academy.qt.io/catalog

                                  _ 2 Replies Last reply
                                  1
                                  • Christian EhrlicherC Christian Ehrlicher

                                    Why not simply using git-bisect on the command line and compile without any make clean before? I don't see any need to call configure.bat again - nothing configure specific will change inbetween those 72 commits in a stable branch - and if you will notice it during compilation.

                                    _ Offline
                                    _ Offline
                                    _BPL_
                                    wrote on last edited by
                                    #20

                                    @Christian-Ehrlicher said in How to compile single Qt module and use it on app?:

                                    Why not simply using git-bisect on the command line and compile without any make clean before? I don't see any need to call configure.bat again - nothing configure specific will change inbetween those 72 commits in a stable branch - and if you will notice it during compilation.

                                    Maybe you're right and probably that's the faster startegy for bug hunting using git-bisect on qtbase. Only advantage of cleaning & reconfiguring is you can keep the good/bad commits living in separate folders (each time I was calling configure.bat I was using as a prefix the result of git describe --tags commit_hash) but consider the only goal is bug hunting probably these good/bad commit folders shouldn't be kept anyway (are they useful for other purposes?)

                                    Anyway, I've found the commit that introduced the bug and it's 1 year old, that's crazy :P !!!! It'd be really interesting to know how long would it take to hunt it using your method when working on latest master (configured&built ready).

                                    I've learned quite a lot thanks to this bug but it's still unclear to me when it's required to reconfigure again before building... it'd be interesting to learn that for future bug huntings :)

                                    1 Reply Last reply
                                    1
                                    • _ Offline
                                      _ Offline
                                      _BPL_
                                      wrote on last edited by
                                      #21

                                      Btw, for those interested on this issue I've posted the results of my bug hunting on the original thread.

                                      Possible fixes are welcome :D

                                      1 Reply Last reply
                                      0
                                      • Christian EhrlicherC Christian Ehrlicher

                                        Why not simply using git-bisect on the command line and compile without any make clean before? I don't see any need to call configure.bat again - nothing configure specific will change inbetween those 72 commits in a stable branch - and if you will notice it during compilation.

                                        _ Offline
                                        _ Offline
                                        _BPL_
                                        wrote on last edited by
                                        #22

                                        @Christian-Ehrlicher said in How to compile single Qt module and use it on app?:

                                        Why not simply using git-bisect on the command line and compile without any make clean before? I don't see any need to call configure.bat again - nothing configure specific will change inbetween those 72 commits in a stable branch - and if you will notice it during compilation.

                                        Btw... I've tested this suggestion and I can tell it won't work, give it a shot and you'll see, you'll probably end up with compiler/linking errors mostly of the time (even reconfiguring), so... yeah, unfortunately the only reliable way I've found to build a new local branch is by doing:

                                        1. git checkout -- . && git clean -fxd :)
                                        2. configure <options>
                                        3. make

                                        Not cool at all :/

                                        1 Reply Last reply
                                        0
                                        • Christian EhrlicherC Online
                                          Christian EhrlicherC Online
                                          Christian Ehrlicher
                                          Lifetime Qt Champion
                                          wrote on last edited by
                                          #23

                                          You can be sure that I compile qtbase more than once a day and calling configure is only needed when switching branches.

                                          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                                          Visit the Qt Academy at https://academy.qt.io/catalog

                                          _ 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