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. issue building qt 5 12 from latest git repo (windows) - part 2
QtWS25 Last Chance

issue building qt 5 12 from latest git repo (windows) - part 2

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 3 Posters 1.5k 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.
  • C Offline
    C Offline
    code_fodder
    wrote on 16 Feb 2019, 10:04 last edited by
    #1

    Following on from: https://forum.qt.io/topic/99743/issue-building-qt-5-12-from-latest-git-repo

    I have now checked out version 5.12.1 (instead of the head of 5.12).

    I have tried building with the following configurations (and with the errors below):

    Static Debug no no-pch

    Configuration: configure -debug -opensource -static -static-runtime -skip webengine -nomake examples -nomake tests -nomake tools -accessibility -no-sql-sqlite -no-opengl -opengl desktop -platform win32-g++ -qt-zlib -qt-libpng -qt-libjpeg -confirm-license -prefix "C:\install\Qt\5.12.1-static"
    I get the error:

    g++ -c -fno-keep-inline-dllexport -g -Og -std=c++1z -fno-exceptions -Wall -W -Wextra -Wvla -Wdate-time -Wshift-overflow=2 -Wduplicated-cond -Wno-stringop-overflow -ffunction-sections -fdata-sections -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DWINVER=0x0601 -D_WIN32_WINNT=0x0601 -DQT_NO_CAST_FROM_ASCII -DQT_NO_FOREACH -DLIBEGL_NAME=libEGL -DLIBGLESV2_NAME=libGLESv2 -DQT_DEPRECATED_WARNINGS -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_NO_EXCEPTIONS -DQT_STATICPLUGIN -DQT_PLUGIN -DQT_EVENTDISPATCHER_SUPPORT_LIB -DQT_FONTDATABASE_SUPPORT_LIB -DQT_THEME_SUPPORT_LIB -DQT_ACCESSIBILITY_SUPPORT_LIB -DQT_WINDOWSUIAUTOMATION_SUPPORT_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_PLUGIN_RESOURCE_INIT_FUNCTION=qwindowsd_plugin_resource_init -ID:/install/Qt/qt5_git_repo/qtbase/src/plugins/platforms/windows -I. -ID:/install/Qt/qt5_git_repo/qtbase/src/plugins/platforms/windows -ID:/install/Qt/qt5_git_repo/qtbase/src/3rdparty/wintab -I../../../../include -I../../../../include/QtEventDispatcherSupport -I../../../../include/QtEventDispatcherSupport/5.12.1 -I../../../../include/QtEventDispatcherSupport/5.12.1/QtEventDispatcherSupport -I../../../../include/QtFontDatabaseSupport -I../../../../include/QtFontDatabaseSupport/5.12.1 -I../../../../include/QtFontDatabaseSupport/5.12.1/QtFontDatabaseSupport -I../../../../include/QtThemeSupport -I../../../../include/QtThemeSupport/5.12.1 -I../../../../include/QtThemeSupport/5.12.1/QtThemeSupport -I../../../../include/QtAccessibilitySupport -I../../../../include/QtAccessibilitySupport/5.12.1 -I../../../../include/QtAccessibilitySupport/5.12.1/QtAccessibilitySupport -I../../../../include/QtWindowsUIAutomationSupport -I../../../../include/QtWindowsUIAutomationSupport/5.12.1 -I../../../../include/QtWindowsUIAutomationSupport/5.12.1/QtWindowsUIAutomationSupport -I../../../../include/QtGui/5.12.1 -I../../../../include/QtGui/5.12.1/QtGui -I../../../../include/QtGui -I../../../../include/QtCore/5.12.1 -I../../../../include/QtCore/5.12.1/QtCore -I../../../../include/QtCore -I.moc/debug -ID:/install/Qt/qt5_git_repo/qtbase/mkspecs/win32-g++  -o .obj/debug/qwindowsole.o D:/install/Qt/qt5_git_repo/qtbase/src/plugins/platforms/windows/qwindowsole.cpp
    In file included from D:/install/Qt/qt5_git_repo/qtbase/src/plugins/platforms/windows/qwindowscontext.cpp:82:0:
    ../../../../include/QtEventDispatcherSupport/5.12.1/QtEventDispatcherSupport/private/qwindowsguieventdispatcher_p.h:1:10: fatal error: ../../../../../../../qt5_git_repo/qtbase/src/platformsupport/eventdispatchers/qwindowsguieventdispatcher_p.h: No such file or directory
     #include "../../../../../../../qt5_git_repo/qtbase/src/platformsupport/eventdispatchers/qwindowsguieventdispatcher_p.h"
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    

    Non static build attempt:

    Configuration: configure -debug -opensource -confirm-license -nomake examples -nomake tests -skip webengine -prefix "C:/install/Qt/5.12.1-sharedlibs"
    Gives the error:

    qopengl.h:111:13: fatal error: GLES2/gl2.h: No such file or directory
    

    Now the second issue is probably something to do with GUI/graphics etc. I have now got windows 10 and I thought I read that open GL is built in and that there is a version of ANGLE withing qtbase - so I thought I was covered for these...

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 16 Feb 2019, 22:40 last edited by aha_1980
      #2

      Hi,

      You are passing both -no-opengl and -opengl desktop, can you check with removing the first one ?

      [Edit aha_1980: Fixed typo]

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

      C 2 Replies Last reply 17 Feb 2019, 00:04
      1
      • S SGaist
        16 Feb 2019, 22:40

        Hi,

        You are passing both -no-opengl and -opengl desktop, can you check with removing the first one ?

        [Edit aha_1980: Fixed typo]

        C Offline
        C Offline
        code_fodder
        wrote on 17 Feb 2019, 00:04 last edited by
        #3

        @SGaist I just noticed that about an hour ago and since then I have been building (make) and installing both static and dynamic libraries. I also encountered this issue: https://superuser.com/questions/1119883/windows-10-enable-ntfs-long-paths-policy-option-missing which was responsible for the first error (because the path was longer then 260 chars). The second issue I think - as you say seems to be related to opengl options - one time when I was configuring (I have been at it throughout the day) I got an actual warning at the end of the config.

        So long story short - between the two issues I had (and needing to install python to do make install) I have finally solved this. I tested the static build (added the kit to my old qt creator). Qt creator built my projects fine (with qt 5.12.1 static) but did not display my source files.... that was a bit odd. Maybe need a newer version. But anyhow the out put file was about 500mb and when I copied it to a clean PC it ran fine (proving the static build worked).

        I am going to write this up with my full set of instructions as much for me as for anyone else - and then I will mark this as solved... but I will do it tomorrow - I am tired....sooooo tired : )

        Have to say, thanks again for your support - its been so long since I did Qt building. To be honest it was a bit painful, but once you have found / solved the little issues its really easy to repeat the build : )

        1 Reply Last reply
        0
        • S SGaist
          16 Feb 2019, 22:40

          Hi,

          You are passing both -no-opengl and -opengl desktop, can you check with removing the first one ?

          [Edit aha_1980: Fixed typo]

          C Offline
          C Offline
          code_fodder
          wrote on 17 Feb 2019, 09:20 last edited by code_fodder
          #4

          @SGaist Actually I removed the second one so I was left with -no-opengl. I presume that I don't really need that unless I am doing graphics (not like GUI but more animations etc)?

          If I want to change my config and recompile can I just do this:

          configure ... new options ...
          make
          make install
          

          Or do I need to completely delete all the files and start again (in my non source folder)?

          1 Reply Last reply
          0
          • C Offline
            C Offline
            code_fodder
            wrote on 17 Feb 2019, 14:27 last edited by
            #5

            Ok here is the list of instructions to build and install qt static and/or shared-libs:

            1. Preparation

            In no particular order:

            • install strawberry perl (required during compilation). Note normal perl does not seem to work very well.
              • from here: http://strawberryperl.com/
            • Get the qt source:
              • git clone https://github.com/qt/qt5.git qt5
              • git checkout 5.12.1 (specific build instead of 5.12 latest)
              • git submodule update --init --recursive
              • git submodule foreach --recursive "git clean -dfx" && git clean -dfx
            • Download and install mingw64 (32 bit) from: https://sourceforge.net/projects/mingw-w64/. I used options:
              • version 7.3.0
              • Arch i686
              • Threads posix
              • Exception dwarf
              • Build-rev 0
            • Windows 10 NTFS long path names
              • Get MediaCreationTool1809.exe from here https://www.microsoft.com/en-gb/software-download/windows10 and run it as admin.
              • https://superuser.com/questions/1119883/windows-10-enable-ntfs-long-paths-policy-option-missing
                • Once you installed step 1 (maybe reboot) then you should be able to do windows button "gpedit.msc" and see the open to open gpedit
                • Right click it, run as admin. Then: Local Computer Policy --> Computer Config --> Administrative Templates --> System --> FileSystem --> Enable Win32 Long Paths (double click)
                • In there click the enable tick box and ok.
            • Install Python (required during make install):
              • From here: https://www.python.org/downloads/

            NOTE: in the mingw folder there should be a mingw-xx.bat file to open an cmd prompt environment for gcc. Run this for all cmd prompts to do the following actions.

            NOTE: make sure you edit the paths so that strawberry perl .../bin is before any other perl's
            So the dos env setup should look like:

            	set PATH=D:\install\StrawberryPerl\perl\bin;%PATH%
            	set PATH=D:\install\mingw-w64\i686-7.3.0-posix-dwarf\mingw32\bin;%PATH%
            	set PATH=D:\install\Qt\qt5\qtbase\bin;%PATH%
            	set PATH=D:\install\Qt\qt5\gnuwin32\bin;%PATH%
            

            Where D:\install\Qt\qt5 is where my qt5 git repo is.

            2. Configuration

            2.1. Static Config

            • Create folder at the same level as ../qt5/ repo called ../qt5-static-build/ (for example) and cd into it, then run:
            - ..\qt5\configure -debug -opensource -static -static-runtime -skip webengine -nomake examples -nomake tests -nomake tools -accessibility -no-sql-sqlite -no-opengl -platform win32-g++ -qt-zlib -qt-libpng -qt-libjpeg -confirm-license -prefix "C:\install\Qt\5.12.1-static"
            

            2.2. Shared Lib Config

            • Create folder at the same level as ../qt5/ repo called ../qt5-build/ (for example) and cd into it, then run:
            ..\qt5\configure -debug -opensource -skip webengine -nomake examples -nomake tests -nomake tools -accessibility -no-sql-sqlite -no-opengl -platform win32-g++ -qt-zlib -qt-libpng -qt-libjpeg -confirm-license -prefix "C:\install\Qt\5.12.1-sharedlib"
            

            3. Compile and installation

            Either way you configured qt (static or not) this part is the same, basically run:

            mingw32-make -j8
            mingw32-make install -j8
            

            Note: you can use whatever parallel number you want (-j<num-jobs>). Each stage takes a while depending on your CPU of course.

            Once you have finished, the install path set in your config line (e.g. C:\install\Qt\5.12.1-static) will contain your qt install. You can then add this in qtcreator as a new qt version (if that is how you are building it).

            1 Reply Last reply
            2
            • C Offline
              C Offline
              code_fodder
              wrote on 17 Feb 2019, 14:29 last edited by
              #6

              @SGaist @kshegunov - So I got qt built statically and dynamically, I just posted up my full instruction set, if you have a minute to spare, can you cast your eye over it to see if there is anything additional I can mention (or edit)?

              Thanks : )

              kshegunovK 1 Reply Last reply 17 Feb 2019, 20:24
              0
              • C code_fodder
                17 Feb 2019, 14:29

                @SGaist @kshegunov - So I got qt built statically and dynamically, I just posted up my full instruction set, if you have a minute to spare, can you cast your eye over it to see if there is anything additional I can mention (or edit)?

                Thanks : )

                kshegunovK Offline
                kshegunovK Offline
                kshegunov
                Moderators
                wrote on 17 Feb 2019, 20:24 last edited by
                #7

                Looks good to me.

                Read and abide by the Qt Code of Conduct

                1 Reply Last reply
                2

                1/7

                16 Feb 2019, 10:04

                • Login

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