Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Error while building Qt 5.7 on Windows
Forum Updated to NodeBB v4.3 + New Features

Error while building Qt 5.7 on Windows

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
17 Posts 4 Posters 6.3k 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.
  • A Offline
    A Offline
    amura.cxg
    wrote on last edited by
    #1

    I'm trying to build Qt on Windows but when I try to run build I get the following error:

    D:\Dev\Qt\5.6\Src\qtbase/qmake/generators/win32/msvc_vcproj.cpp: In function 'DotNET which_dotnet_version(const QByteArray&)':
    D:\Dev\Qt\5.6\Src\qtbase/qmake/generators/win32/msvc_vcproj.cpp:113:43: error: 'KEY_WOW64_32KEY' was not declared in this scope
    KEY_WOW64_32KEY);
    ^
    Makefile:248: recipe for target 'msvc_vcproj.o' failed
    mingw32-make: *** [msvc_vcproj.o] Error 1
    Building qmake failed, return code 2

    Both MinGW and the source files are downloaded through the Qt Maintenance Tool. I've tried this on both 5.6 and 5.7 but I get the same error. Is this an issue with the source or the way I'm compiling?

    jsulmJ 1 Reply Last reply
    0
    • A amura.cxg

      I'm trying to build Qt on Windows but when I try to run build I get the following error:

      D:\Dev\Qt\5.6\Src\qtbase/qmake/generators/win32/msvc_vcproj.cpp: In function 'DotNET which_dotnet_version(const QByteArray&)':
      D:\Dev\Qt\5.6\Src\qtbase/qmake/generators/win32/msvc_vcproj.cpp:113:43: error: 'KEY_WOW64_32KEY' was not declared in this scope
      KEY_WOW64_32KEY);
      ^
      Makefile:248: recipe for target 'msvc_vcproj.o' failed
      mingw32-make: *** [msvc_vcproj.o] Error 1
      Building qmake failed, return code 2

      Both MinGW and the source files are downloaded through the Qt Maintenance Tool. I've tried this on both 5.6 and 5.7 but I get the same error. Is this an issue with the source or the way I'm compiling?

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

      @amura.cxg How did you call configure? It looks like you're trying to build with MS C++ compiler, but you write that you downloaded MinGW.

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

      1 Reply Last reply
      0
      • A Offline
        A Offline
        amura.cxg
        wrote on last edited by
        #3

        I called configure with the following: configure -debug -nomake examples -opensource -platform win32-g++

        I've been (mostly) following this guide. If you're curious this is what I have in my qt5vars.cmd file:

        @ECHO off
        
        SET _QT_SRC=D:\Dev\Qt\5.6\Src
        SET _MINGW=D:\Dev\Qt\5.6\mingw49_32
        SET _JOM=D:\Dev\Jom
        
        REM Add the MinGW bin directory to the path
        SET PATH=%_MINGW%\bin;%PATH%
        
        REM Add the QT directories to the path
        SET PATH=%_QT_SRC%\qtbase\bin;%_QT_SRC%\gnuwin32\bin;%PATH%
        
        REM Add the Jom directory to the path
        SET PATH=%_JOM%;%PATH%
        
        REM SET QMAKESPEC=win32-msvc2013
        
        CD %_QT_SRC%
        
        SET _QT_SRC=
        SET _MINGW=
        SET _JOM=
        
        kshegunovK 1 Reply Last reply
        0
        • A Offline
          A Offline
          amura.cxg
          wrote on last edited by
          #4

          So out of curiosity I decided to try running the configure command on version 5.5 and I didn't get any errors. So maybe there are is something up with 5.6 and 5.7 in Windows?

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

            Hi,

            Since you want to build for Visual Studio 2013, why are you setting up your environment to build with MinGW ?

            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
            • A Offline
              A Offline
              amura.cxg
              wrote on last edited by
              #6

              Sorry, should have specified. I do want to build with MinGW

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

                Then why are you setting QMAKESPEC to Visual Studio 2013 ?

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

                kshegunovK 1 Reply Last reply
                0
                • SGaistS SGaist

                  Then why are you setting QMAKESPEC to Visual Studio 2013 ?

                  kshegunovK Offline
                  kshegunovK Offline
                  kshegunov
                  Moderators
                  wrote on last edited by kshegunov
                  #8

                  @SGaist
                  That's a comment in the M$ language (starts with REM) ... :)

                  Read and abide by the Qt Code of Conduct

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

                    @kshegunov I didn't pay attention to that one. Good catch.

                    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
                    • A amura.cxg

                      I called configure with the following: configure -debug -nomake examples -opensource -platform win32-g++

                      I've been (mostly) following this guide. If you're curious this is what I have in my qt5vars.cmd file:

                      @ECHO off
                      
                      SET _QT_SRC=D:\Dev\Qt\5.6\Src
                      SET _MINGW=D:\Dev\Qt\5.6\mingw49_32
                      SET _JOM=D:\Dev\Jom
                      
                      REM Add the MinGW bin directory to the path
                      SET PATH=%_MINGW%\bin;%PATH%
                      
                      REM Add the QT directories to the path
                      SET PATH=%_QT_SRC%\qtbase\bin;%_QT_SRC%\gnuwin32\bin;%PATH%
                      
                      REM Add the Jom directory to the path
                      SET PATH=%_JOM%;%PATH%
                      
                      REM SET QMAKESPEC=win32-msvc2013
                      
                      CD %_QT_SRC%
                      
                      SET _QT_SRC=
                      SET _MINGW=
                      SET _JOM=
                      
                      kshegunovK Offline
                      kshegunovK Offline
                      kshegunov
                      Moderators
                      wrote on last edited by kshegunov
                      #10

                      @amura.cxg

                      Did you install mingw with Qt's maintenance tool? If so, then in your start menu you will have a shortcut for the Qt (MinGW) command prompt. Start it and in the root dir just issue configure ... and then mingw32-make .

                      PS.
                      There's no jom with mingw, jom is a fix for MS's nmake.

                      Read and abide by the Qt Code of Conduct

                      A 2 Replies Last reply
                      0
                      • kshegunovK kshegunov

                        @amura.cxg

                        Did you install mingw with Qt's maintenance tool? If so, then in your start menu you will have a shortcut for the Qt (MinGW) command prompt. Start it and in the root dir just issue configure ... and then mingw32-make .

                        PS.
                        There's no jom with mingw, jom is a fix for MS's nmake.

                        A Offline
                        A Offline
                        amura.cxg
                        wrote on last edited by
                        #11
                        This post is deleted!
                        1 Reply Last reply
                        0
                        • kshegunovK kshegunov

                          @amura.cxg

                          Did you install mingw with Qt's maintenance tool? If so, then in your start menu you will have a shortcut for the Qt (MinGW) command prompt. Start it and in the root dir just issue configure ... and then mingw32-make .

                          PS.
                          There's no jom with mingw, jom is a fix for MS's nmake.

                          A Offline
                          A Offline
                          amura.cxg
                          wrote on last edited by amura.cxg
                          #12

                          @kshegunov I did indeed, I gave that a try and it worked perfectly. I managed to configure and make with no problems. I really appreciate your help!

                          I do have another question regarding cross compiling. Some context first; my ultimate goal is to cross compile Qt for my Raspberry Pi and setup a kit in Qt Creator so I can develop in the creator on my Windows PC and then push the cross compiled code to the Pi. I've been reading through a couple guides (first, second) and in the first guide it says to configure without the -device-option CROSS_COMPILE option to build qmake (Steps 12-14) then to configure and make with the -device-option CROSS_COMPILE option. However the second guide doesn't do this but this second guide is for building on Linux.

                          My question is: Do I need to configure without the cross compile option then do it again with it? Or am I safe to just configure and make once with the option?

                          Again, I really appreciate the help so far. I'm a bit of a noob and once I get everything working I'm hoping to write up a guide as I found there wasn't one that achieved the same thing I'm trying.

                          1 Reply Last reply
                          0
                          • kshegunovK Offline
                            kshegunovK Offline
                            kshegunov
                            Moderators
                            wrote on last edited by
                            #13

                            I did indeed, I gave that a try and it worked perfectly. I managed to configure and make with no problems.

                            I'm glad. The Qt (mingw) command prompt will just call all the needed initialization scripts to set your build environment up.

                            My question is: Do I need to configure without the cross compile option then do it again with it? Or am I safe to just configure and make once with the option?

                            +1 for the description, but I really can't say. I've never in my life cross-compiled anything, much less Qt. I would guess that you need to cross compile qmake only if you intend on running it on the embedded device, but again, I'm just speculating here.

                            Kind regards.

                            Read and abide by the Qt Code of Conduct

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

                              If I may, it would be way easier to do the cross-compiler stuff from a Linux virtual machine. It simplifies things a lot.

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

                              A 1 Reply Last reply
                              0
                              • SGaistS SGaist

                                If I may, it would be way easier to do the cross-compiler stuff from a Linux virtual machine. It simplifies things a lot.

                                A Offline
                                A Offline
                                amura.cxg
                                wrote on last edited by
                                #15

                                @SGaist Haha yeah I was starting to feel that was the case. Probably a dumb question, but if I cross compile Qt on Linux will I still be able to develop on my Windows (assuming I have the right cross compiler)? Is the cross compiling step only to get Qt onto my device?

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

                                  The cross-compiling part is to build the libraries for your device but also to give you a SDK that you can use on your computer to build the application. So technically, you still need to cross-compile Qt from Windows if you want to cross-compile the application there for your target. Otherwise you can also develop on Windows and only fire-up your Linux machine when you want to build/run for your target.

                                  In any case, Qt Creator is available for both OSs so you won't have too much trouble to develop directly on Linux.

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

                                  A 1 Reply Last reply
                                  0
                                  • SGaistS SGaist

                                    The cross-compiling part is to build the libraries for your device but also to give you a SDK that you can use on your computer to build the application. So technically, you still need to cross-compile Qt from Windows if you want to cross-compile the application there for your target. Otherwise you can also develop on Windows and only fire-up your Linux machine when you want to build/run for your target.

                                    In any case, Qt Creator is available for both OSs so you won't have too much trouble to develop directly on Linux.

                                    A Offline
                                    A Offline
                                    amura.cxg
                                    wrote on last edited by
                                    #17

                                    @SGaist ok that makes sense, thanks! I'm going to give cross compiling on Windows a couple more tries, I want to see if it's possible mostly because there seems to be a bit of a lack of information around it so if I could help fill that in that would hopefully help someone in the future. Though I suspect I'll be developing in Linux soon haha

                                    Thanks for all the information, with the help I've got from here I've learned a lot

                                    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