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. Building Qt 5.7 with MingW64
Qt 6.11 is out! See what's new in the release blog

Building Qt 5.7 with MingW64

Scheduled Pinned Locked Moved Unsolved General and Desktop
18 Posts 5 Posters 8.9k Views 1 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.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #9

    @Buckwheat, yes you can. There are already some pages about building Qt e.g. from git.

    @r2com Since Qt 5.5 the backend selection on Windows is dynamic so it basically depends on what GPU/Driver combo you have on a machine. You can force loading the OpenGL backend though.

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

    ? 1 Reply Last reply
    0
    • SGaistS SGaist

      @Buckwheat, yes you can. There are already some pages about building Qt e.g. from git.

      @r2com Since Qt 5.5 the backend selection on Windows is dynamic so it basically depends on what GPU/Driver combo you have on a machine. You can force loading the OpenGL backend though.

      ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #10

      @SGaist can you expand more on that please?

      How can I force loading the OpenGL backend?

      (i.e. when I open the Boxes OpenGL example, i cant run/build it, because it tells me that for this example to run the Qt had to be compiled with -opengl desktop option)

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

        You can set the QT_OPENGL environment variable to desktop or set the application attribute Qt::AA_UseDesktopOpenGL before creating your application object.

        More information here.

        As for the example, you can try by commenting the OpenGL check in the .pro file and either set the environment variable or modify the main.cpp to set the application attribute.

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

        ? 1 Reply Last reply
        1
        • SGaistS SGaist

          You can set the QT_OPENGL environment variable to desktop or set the application attribute Qt::AA_UseDesktopOpenGL before creating your application object.

          More information here.

          As for the example, you can try by commenting the OpenGL check in the .pro file and either set the environment variable or modify the main.cpp to set the application attribute.

          ? Offline
          ? Offline
          A Former User
          wrote on last edited by A Former User
          #12

          @SGaist Looking into this now.

          Another question, is there any way to have Qt 5.7 use the Mingw64 compiler as well instead of Msvc64? Or in that case I definitely need to comnpile Qt myself?

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

            No you can't but that's nothing Qt specific. You can't mix and match compilers on Windows. Even the different version of MSVC are not compatible one with the other.

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

            ? 1 Reply Last reply
            0
            • SGaistS SGaist

              No you can't but that's nothing Qt specific. You can't mix and match compilers on Windows. Even the different version of MSVC are not compatible one with the other.

              ? Offline
              ? Offline
              A Former User
              wrote on last edited by
              #14

              @SGaist Also, meanwhile I am trying now to build it with MSYS2, and here is an error I have encountered:

              C:/Qt/qt5/qtbase/src/corelib/tools/qsimd.cpp:43:22: fatal error: QByteArray: No such file or directory
               #include <QByteArray>
                                    ^
              compilation terminated.
              
              

              Any ideas what is going on?

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

                I'd check whether the forwarded headers were created successfully.

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

                1 Reply Last reply
                0
                • ? Offline
                  ? Offline
                  A Former User
                  wrote on last edited by
                  #16

                  But isn't it not dependent on me? In other words, should I just start searching for the file name "QByteArray" and just correcting each source file to point to it? That rather sounds not good to me though...

                  And another question, now regarding those attributes, I opened that OpenGL Boxes example now in the Installed QtCreator, and put this line right before instantiating QApplication:

                  setAttribute(Qt::AA_UseDesktopOpenGL, true);
                  

                  And got the rrror:
                  ..\boxes\main.cpp(114): error C3861: 'setAttribute': identifier not found

                  What is the proper way of setting that attribute?

                  1 Reply Last reply
                  0
                  • ? Offline
                    ? Offline
                    A Former User
                    wrote on last edited by A Former User
                    #17

                    OK nevermind I had to set attribute this way:

                        QApplication app(argc, argv);
                        app.setAttribute(Qt::AA_UseDesktopOpenGL, true);
                    

                    However; now I get tons of LNK2019 errors, like:

                    glbuffers.obj:-1: error: LNK2019: unresolved external symbol __imp_glDisable referenced in function "public: virtual void __cdecl GLTexture2D::unbind(void)" (?unbind@GLTexture2D@@UEAAXXZ)
                    
                    File not found: glbuffers.obj
                    

                    Am I supposed to do something more than just setting the OpenGL related attribute?

                    1 Reply Last reply
                    0
                    • ? Offline
                      ? Offline
                      A Former User
                      wrote on last edited by
                      #18

                      Alright, I also added "LIBS += opengl32.lib" to the boxes.pro file, now it compiles and runs..so, I guess it worked.

                      In any case, building mingw64 with Qt is just straight out disaster, unless one is going to spend significant time on resolving things or be part of dev team...

                      The main download page for Qt has all kinds of pre-built versions, MSVC64 and MINGW32...but why not MINGW64..

                      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