Important: Please read the Qt Code of Conduct -

Build Qt5 from git with msys2 fails on wrong includes

  • Hi,
    i try to build Qt from source for windows desktop with mingw2. For that rison i do the following steps:

    • git clone git://
    • perl init-repository --branch --no-update
    • sh ..\qt5.\configure -c++std c++11 -platform win32-g++ -prefix D:\0000_Tools\19_Qt\02_Prefix -opensource -debug-and-release -static -static-runtime -opengl desktop -nomake examples -nomake tests -confirm-license
    • make -j8

    if i do that, i run in the following error:

     fatal error: QVector: No such file or directory
     #include <QVector>
    compilation terminated.
    make[4]: *** [Makefile.Debug:15071: .obj/debug/qcollator.o] Error 1
    make[4]: Leaving directory '/d/0000_Tools/19_Qt/01_GIT_Qt5/ShadowBuild/qtbase/sr

    if i look in the Folder:
    there is a file:
    But not a QVector.h

    If i Change the Linefrom
    #include <QVector>
    to :
    #include "qvector.h"

    this module compiles,
    but the in run in a further include error:

    p:53:10: fatal error: QtCore/QSet: No such file or directory
     #include <QtCore/QSet>

    and so on...

    Can anyone show me what is going worng with that ??
    May i bootstrap Qt with a Compiler which does not have a Qt installed by itselfe ??

    Thanks in advance for the help,

  • Lifetime Qt Champion


    Why not build Qt with the version of MinGW provided directly with the installer ?

  • Hi SGaist,

    I really wanted to avoid that to pervent too much compilers on mu System ...

  • Lifetime Qt Champion

    What version of MinGW do you have installed ?

  • gcc —Version 7.3.0 ( msys2 muild in )

  • Lifetime Qt Champion

    So you have an error in your title. You wrote Build Qt5 from git with mingw2 fails on wrong includes

    Did you already saw ?

  • Thx, i have changed the title "mingw2 -> msys2"

  • Hi,
    I had the same problem and found this thread by googling.

    After asking on IRC Thiago told use the solution : you have to put another perl distribution in your PATH before msys perl (Thiago recommended StrawberryPerl, I also tested with ActivePerl and it seems to work) and then run ./configure.

Log in to reply