Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. QtonPi
  4. Cross-compiling 5.7 on Windows
QtWS25 Last Chance

Cross-compiling 5.7 on Windows

Scheduled Pinned Locked Moved Unsolved QtonPi
windows 7raspberry piqt 5.7cross-compiling
4 Posts 2 Posters 3.9k 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.
  • A Offline
    A Offline
    amura.cxg
    wrote on 31 Aug 2016, 19:31 last edited by
    #1

    I want to cross compile Qt for my RPi on Widnows and I'm a little stuck right now. I tried this guide but had some issues at step 12. I decided to scrap everything and start again, this time following this guide to get my environment setup.

    My steps so far:

    1. Installed Qt Creator with Qt 5.7 including the source code and MinGW
    2. Downloaded Jom
    3. Created the cmd file to setup my variables
    4. Run configure -platform win32-g++ -debug -nomake examples -opensource

    Doing this gives me an error that '_popen' was not declared in this scope in qmakebuiltins.cpp

    What am I missing or am I approaching this all wrong?

    Below is the .cmd file that sets up my variables

    SET _QT_SRC=D:\Dev\Qt\5.7\Src
    SET _MINGW=D:\Dev\Qt\5.7\mingw53_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=
    
    

    My end goal is to have Qt with OpenGl ES on my RPi and develop on my Windows PC

    1 Reply Last reply
    0
    • A Offline
      A Offline
      amura.cxg
      wrote on 1 Sept 2016, 02:55 last edited by
      #2

      I managed to move forward, slightly. I did some research and it was suggested that I add the -U__STRICT_ANSI__ flag. I tried adding it to the qmake.conf file as per Step 11 of this guide but that didn't work. I decided to add the flag to the generated \qtbase\gmake\Makefile and ran it manually. I now get a different error (the same error I ran into when I first tried compiling everything before I decided to restart from scratch):

      D:\Dev\Qt-Build\qt-everywhere-opensource-src-5.7.0\qtbase/qmake/generators/win32/msvc_vcproj.cpp: In function 'DotNET which_dotnet_version(const QByteArray&)':
      D:\Dev\Qt-Build\qt-everywhere-opensource-src-5.7.0\qtbase/qmake/generators/win32/msvc_vcproj.cpp:108:43: error: 'KEY_WOW64_32KEY' was not declared in this scope
      
                                                 KEY_WOW64_32KEY);
                                                 ^
      make: *** [msvc_vcproj.o] Error 1
      

      I tried Goolg'ing this before and came up with nothing. Any ideas?

      1 Reply Last reply
      0
      • B Offline
        B Offline
        BruceNaylor
        wrote on 4 Sept 2016, 06:55 last edited by BruceNaylor 9 Apr 2016, 14:59
        #3

        My "fudge" to get around the issues were simply:

        in qtbase\mkspecs\win32-g++

        in qmake.conf modify QMAKE_CXXFLAGS to read:
        "QMAKE_CXXFLAGS = $$QMAKE_CFLAGS -U__STRICT_ANSI__ -D KEY_WOW64_64KEY=0x0100 -DKEY_WOW64_32KEY=0x0200"

        in qplatformdefs.h disable the definition of EXTENDED_NAME_FORMAT, ie change the #if/#endif wrap
        "#if !defined(_WIN32_WINNT) || (_WIN32_WINNT-0 < 0x0500)" to
        "#if 0 //!defined(_WIN32_WINNT) || (_WIN32_WINNT-0 < 0x0500)"

        To fix a "make" issue...

        In qtbase\src\corelib\global\qglobal.h disable the dynamic_cast check, so change
        "#if defined(QT_NO_DYNAMIC_CAST) && !defined(dynamic_cast)" to
        "#if 0 // defined(QT_NO_DYNAMIC_CAST) && !defined(dynamic_cast)"

        Not a fix, a fudge, but it allows qmake to build, and "make && make install" to complete.

        Bruce.

        A 1 Reply Last reply 4 Sept 2016, 18:11
        1
        • B BruceNaylor
          4 Sept 2016, 06:55

          My "fudge" to get around the issues were simply:

          in qtbase\mkspecs\win32-g++

          in qmake.conf modify QMAKE_CXXFLAGS to read:
          "QMAKE_CXXFLAGS = $$QMAKE_CFLAGS -U__STRICT_ANSI__ -D KEY_WOW64_64KEY=0x0100 -DKEY_WOW64_32KEY=0x0200"

          in qplatformdefs.h disable the definition of EXTENDED_NAME_FORMAT, ie change the #if/#endif wrap
          "#if !defined(_WIN32_WINNT) || (_WIN32_WINNT-0 < 0x0500)" to
          "#if 0 //!defined(_WIN32_WINNT) || (_WIN32_WINNT-0 < 0x0500)"

          To fix a "make" issue...

          In qtbase\src\corelib\global\qglobal.h disable the dynamic_cast check, so change
          "#if defined(QT_NO_DYNAMIC_CAST) && !defined(dynamic_cast)" to
          "#if 0 // defined(QT_NO_DYNAMIC_CAST) && !defined(dynamic_cast)"

          Not a fix, a fudge, but it allows qmake to build, and "make && make install" to complete.

          Bruce.

          A Offline
          A Offline
          amura.cxg
          wrote on 4 Sept 2016, 18:11 last edited by
          #4

          @BruceNaylor Hmm that's interesting! I posted on the C++ Gurus forum and a couple guys there suggested I use the MinGW that gets installed with QT Creator (when you select that option) and that actually fixed my issue with registry keys. I was going to give cross compiling another try on Windows, maybe your fudges will fix some other issues I've into. I appreciate the suggestions!

          1 Reply Last reply
          1

          1/4

          31 Aug 2016, 19:31

          • Login

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