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. Cross compile Qt (Windows) to Raspberry 3

Cross compile Qt (Windows) to Raspberry 3

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
raspberry pi 3cross compile ttoolchain
31 Posts 17 Posters 53.7k 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.
  • L Offline
    L Offline
    lygstate
    wrote on 6 Feb 2017, 09:00 last edited by
    #8

    Where to download MINGW64 gcc 4.9.2

    J 1 Reply Last reply 6 Feb 2017, 09:22
    0
    • L lygstate
      6 Feb 2017, 09:00

      Where to download MINGW64 gcc 4.9.2

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 6 Feb 2017, 09:22 last edited by jsulm 2 Jun 2017, 09:23
      #9

      @lygstate The easiest way is to use Qt Maintenance Tool if you used Qt Online Installer to install Qt.
      Also, how is your question related to this thread?

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

      1 Reply Last reply
      0
      • L Offline
        L Offline
        lygstate
        wrote on 7 Feb 2017, 02:08 last edited by
        #10

        How to exclude qtscript from build?

        J 1 Reply Last reply 7 Feb 2017, 05:57
        0
        • L Offline
          L Offline
          lygstate
          wrote on 7 Feb 2017, 02:25 last edited by lygstate 2 Jul 2017, 06:17
          #11

          If the steps is not appear, then following the steps in https://visualgdb.com/tutorials/raspberry/qt/embedded/, otherwise using the steps below instead

          • Step 3: Download gcc 4.9.2 for Windows
            https://wiki.qt.io/MinGW
            https://download.qt.io/online/qtsdkrepository/windows_x86/desktop/tools_mingw/
            The download URL is
            https://download.qt.io/online/qtsdkrepository/windows_x86/desktop/tools_mingw/qt.tools.win32_mingw492/4.9.2-1i686-4.9.2-release-posix-dwarf-rt_v3-rev1.7z
            extract as C:/SysGCC/mingw32
            gcc would placed at C:/SysGCC/mingw32/bin/gcc.exe

          • Step 5: Download Qt 5.8.0/Qt 5.6.1 source
            and extract as
            C:\SysGCC\qt-everywhere-opensource-src-5.8.0
            There is path C:\SysGCC\qt-everywhere-opensource-src-5.8.0\qtbase

          • Step 6: Sync sysroot

            /lib
            /usr/include
            /usr/lib
            /usr/local/include
            /usr/local/lib
            /opt
            
            /opt/vc
            
          • Step 7: Install MSYS2
            Download newest msys2 from http://www.msys2.org/
            http://repo.msys2.org/distrib/x86_64/msys2-x86_64-20161025.exe
            Install it.
            open msys2/mingw32.exe

            pacman -S make perl pkg-config diffutils
            

            Close the shell

          • Steop 8: Edit ~/.bashrc
            Append following lines

            export PATH=$PATH:/c/SysGCC/mingw32/bin
            export PATH=$PATH:/c/Python27
            export PATH=$PATH:/c/SysGCC/Raspberry/bin
            mkdir -p /c/SysGCC/qt-build
            cd /c/SysGCC/qt-build
            

            open msys2/mingw32.exe

          • Step 9: Check that gcc is linked to C:/SysGCC/mingw32/bin/gcc.exe

          • Step10: Prepare the source code
            Copy folder qt-everywhere-opensource-src-5.8.0\qtbase\mkspecs\linux-arm-gnueabi-g++\
            and it's contents as
            qt-everywhere-opensource-src-5.8.0\qtbase\mkspecs\linux-arm-gnueabihf-g++\
            in folder qt-everywhere-opensource-src-5.8.0\qtbase\mkspecs\linux-arm-gnueabihf-g++\
            grep -irn arm-linux-gnueabi- arm-linux-gnueabihf- .

            Edit qt-everywhere-opensource-src-5.8.0\qtbase\mkspecs\devices\linux-rpi3-g++\qmake.conf
            Replace part lines with (This should also works for Qt 5.6.1, not tested for OpenGL ES):

            VC_LIBRARY_PATH         = $$[QT_SYSROOT]/opt/vc/lib
            VC_INCLUDE_PATH         = $$[QT_SYSROOT]/opt/vc/include
            
            QMAKE_LFLAGS           += -L$${VC_LIBRARY_PATH}
            
            VC_LINK_LINE            = -L$${VC_LIBRARY_PATH}
            
          • Step 12: Configure for Host & Target(Only Qt 5.8 and upper, Qt 5.7 not tested)
            For Qt 5.8 Host & Target
            No step 16, results are in step 16.

            ../qt-everywhere-opensource-src-5.8.0/configure -skip qtscript -platform win32-g++ -xplatform linux-arm-gnueabihf-g++ -release -device linux-rpi3-g++ -sysroot C:/SysGCC/Raspberry/arm-linux-gnueabihf/sysroot -prefix /usr/local/qt5 -device-option CROSS_COMPILE=C:/SysGCC/Raspberry/bin/arm-linux-gnueabihf- -nomake examples -opensource -confirm-license
            

            For Qt 5.6 and lower, Only Host

            ../qt-everywhere-opensource-src-5.6.1/configure -skip qtscript -platform win32-g++ -xplatform linux-arm-gnueabihf-g++ -release -device linux-rpi3-g++ -sysroot C:/SysGCC/Raspberry/arm-linux-gnueabihf/sysroot -prefix /usr/local/qt5 -opensource -confirm-license
            
          • Step13: Skip

          • Step 14: This is normal as long as qmake.exe got built. Check this by running qtbase/bin/qmake -v

          • Step 15: Skip

          • Step 16: Configure the Target (Only Qt 5.6 and lower), otherwise Skip it
            Remove -std=c++1z from qt-everywhere-opensource-src-5.6.1\qtbase\mkspecs\devices\linux-rpi3-g++\qmake.conf
            Qt 5.6.x execute the following command

            ../qt-everywhere-opensource-src-5.6.1/configure -skip qtscript -platform win32-g++ -xplatform linux-arm-gnueabihf-g++ -release -device linux-rpi3-g++ -sysroot C:/SysGCC/Raspberry/arm-linux-gnueabihf/sysroot -prefix /usr/local/qt5 -device-option CROSS_COMPILE=C:/SysGCC/Raspberry/bin/arm-linux-gnueabihf- -nomake examples -opensource -confirm-license
            
          • Step 17: Building And Install

            make && make install
            
          1 Reply Last reply
          1
          • L lygstate
            7 Feb 2017, 02:08

            How to exclude qtscript from build?

            J Offline
            J Offline
            jsulm
            Lifetime Qt Champion
            wrote on 7 Feb 2017, 05:57 last edited by
            #12

            @lygstate Pass this to configure:

            -skip qtscript
            

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

            L 1 Reply Last reply 7 Feb 2017, 06:15
            0
            • J jsulm
              7 Feb 2017, 05:57

              @lygstate Pass this to configure:

              -skip qtscript
              
              L Offline
              L Offline
              lygstate
              wrote on 7 Feb 2017, 06:15 last edited by
              #13

              @jsulm Thanks, I am using this method.

              1 Reply Last reply
              0
              • C Offline
                C Offline
                CrazyCreepy
                wrote on 26 Feb 2017, 02:34 last edited by
                #14

                I do all the tuto and i can make a excutable with qt but the qlabel and the qpushbutton it isn't show. i think it's because when create the qmake the modul gtk isn't enable. when i try to enable it that said

                ERROR: Feature 'gtk3' was enabled, but the pre-condition 'features.glib && libs.gtk3' failed.

                it's do 1 week i try to fine how to fix the pre-condition.

                J 1 Reply Last reply 27 Feb 2017, 07:17
                0
                • C CrazyCreepy
                  26 Feb 2017, 02:34

                  I do all the tuto and i can make a excutable with qt but the qlabel and the qpushbutton it isn't show. i think it's because when create the qmake the modul gtk isn't enable. when i try to enable it that said

                  ERROR: Feature 'gtk3' was enabled, but the pre-condition 'features.glib && libs.gtk3' failed.

                  it's do 1 week i try to fine how to fix the pre-condition.

                  J Offline
                  J Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on 27 Feb 2017, 07:17 last edited by
                  #15

                  @CrazyCreepy "qlabel and the qpushbutton it isn't show" - what does it mean? Are they not shown at all, or no text?
                  For gtk3 support you probably need to install gtk3 dev packages, but it actually should work without.
                  If there is no text then you probably have some font issues.

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

                  C 1 Reply Last reply 27 Feb 2017, 19:57
                  0
                  • J jsulm
                    27 Feb 2017, 07:17

                    @CrazyCreepy "qlabel and the qpushbutton it isn't show" - what does it mean? Are they not shown at all, or no text?
                    For gtk3 support you probably need to install gtk3 dev packages, but it actually should work without.
                    If there is no text then you probably have some font issues.

                    C Offline
                    C Offline
                    CrazyCreepy
                    wrote on 27 Feb 2017, 19:57 last edited by
                    #16

                    @jsulm I mean the label and push button doesn't exist! if i wants to close my windows i will use httop... it work without gtk3 but not all feature is enable and this can be very problematic later... and i installe Gtk3 on my rasp, but they change noting i need to configure in my compiler but i don't know how .

                    J 1 Reply Last reply 28 Feb 2017, 05:21
                    0
                    • C CrazyCreepy
                      27 Feb 2017, 19:57

                      @jsulm I mean the label and push button doesn't exist! if i wants to close my windows i will use httop... it work without gtk3 but not all feature is enable and this can be very problematic later... and i installe Gtk3 on my rasp, but they change noting i need to configure in my compiler but i don't know how .

                      J Offline
                      J Offline
                      jsulm
                      Lifetime Qt Champion
                      wrote on 28 Feb 2017, 05:21 last edited by
                      #17

                      @CrazyCreepy As I said you need to install gtk3/glib dev packages on your RPi/sysroot and then build Qt (there is nothing to configure in compiler).
                      "label and push button doesn't exist" - you probably mean - they are not shown?

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

                      1 Reply Last reply
                      0
                      • C Offline
                        C Offline
                        CrazyCreepy
                        wrote on 2 Mar 2017, 20:58 last edited by CrazyCreepy 3 Feb 2017, 23:09
                        #18

                        that what i get on my raspberry pi
                        alt text
                        and that was i get
                        alt text

                        I have already install the glib and gtk3 on my raspberry... I also try to syncronize all of my raspberry pi with smartputty in my sysroot and it's doesn't work... I'm little exhausted of this.... thanks for help.

                        1 Reply Last reply
                        0
                        • P Offline
                          P Offline
                          pinballsp
                          wrote on 4 Mar 2017, 01:16 last edited by pinballsp 3 Apr 2017, 01:20
                          #19

                          Hello.

                          Very good instructions to config QT5 for RPY3 with cross. I try to install but fail in step6, seem some permissions problem, but do not know why, I work with Administrator user, and I have change permissions to all files to get access to all users.

                          This is capture screen about fail when I try to run step 6 to syncronize sysroot. Somebody may help me, why fail ??. Translation to english language about the error message is "Cannot connect: Try to access to one socket not allowed because your access permissions 192.168.1.7"

                          If I run directly StmarTTY from Windows work perfectly, but I run SmarTTY from a DOS window also fail with same error message,

                          alt text

                          1 Reply Last reply
                          0
                          • P Offline
                            P Offline
                            pinballsp
                            wrote on 5 Mar 2017, 20:52 last edited by pinballsp 3 May 2017, 21:27
                            #20

                            .

                            Hello.

                            My before problem was because the firewall, already solved. I have follow instructions of lystate user, and all seem ok but fail in last step, with this error message.

                            Somebody know how to solve this problem to may compile ??

                            alt text

                            .

                            And this is the content of the config.log file:

                            executing config test use_gold_linker
                            cd C:\SysGCC\qt-build\qtbase\config.tests && C:/SysGCC/Raspberry/bin/arm-linux-gnueabihf-g++ -fuse-ld=gold -o conftest-out conftest.cpp
                            cc1plus.exe: error: unrecognized command line option '-fuse-ld=gold'

                            test config.qtbase.tests.use_gold_linker FAILED
                            executing config test verifyspec

                            cd C:\SysGCC\qt-build\qtbase\config.tests\common\verifyspec && C:\SysGCC\qt-build\qtbase\bin\qmake.exe -qtconf C:/SysGCC/qt-build/qtbase/bin/qt.conf "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared console" "QMAKE_CFLAGS += --sysroot=C:/SysGCC/Raspberry/arm-linux-gnueabihf/sysroot" "QMAKE_CXXFLAGS += --sysroot=C:/SysGCC/Raspberry/arm-linux-gnueabihf/sysroot" "QMAKE_LFLAGS += --sysroot=C:/SysGCC/Raspberry/arm-linux-gnueabihf/sysroot" C:/SysGCC/qt-everywhere-opensource-src-5.8.0/qtbase/config.tests/common/verifyspec

                            cd C:\SysGCC\qt-build\qtbase\config.tests\common\verifyspec && set MAKEFLAGS=& C:/SysGCC/msys2/usr/bin/make

                            C:/SysGCC/Raspberry/bin/arm-linux-gnueabihf-g++ -c -march=armv8-a -mtune=cortex-a53 -mfpu=crypto-neon-fp-armv8 -mfloat-abi=hard --sysroot=C:/SysGCC/Raspberry/arm-linux-gnueabihf/sysroot -O2 -Wall -W -fPIC -IC:/SysGCC/qt-everywhere-opensource-src-5.8.0/qtbase/config.tests/common/verifyspec -I. -IC:/SysGCC/qt-everywhere-opensource-src-5.8.0/qtbase/mkspecs/devices/linux-rpi3-g++ -o verifyspec.obj C:/SysGCC/qt-everywhere-opensource-src-5.8.0/qtbase/config.tests/common/verifyspec/verifyspec.cpp

                            cc1plus.exe: error: bad value (armv8-a) for -march switch
                            cc1plus.exe: error: bad value (cortex-a53) for -mtune switch

                            C:/SysGCC/qt-everywhere-opensource-src-5.8.0/qtbase/config.tests/common/verifyspec/verifyspec.cpp:1:0: error: invalid floating point option: -mfpu=crypto-neon-fp-armv8
                            make: *** [Makefile:176: verifyspec.obj] Error 1
                            executing config test verifyspec

                            cd C:\SysGCC\qt-build\qtbase\config.tests\common\verifyspec && C:\SysGCC\qt-build\qtbase\bin\qmake.exe -qtconf C:/SysGCC/qt-build/qtbase/bin/qt.conf "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared console" "QMAKE_CFLAGS += --sysroot=C:/SysGCC/Raspberry/arm-linux-gnueabihf/sysroot" "QMAKE_CXXFLAGS += --sysroot=C:/SysGCC/Raspberry/arm-linux-gnueabihf/sysroot" "QMAKE_LFLAGS += --sysroot=C:/SysGCC/Raspberry/arm-linux-gnueabihf/sysroot" C:/SysGCC/qt-everywhere-opensource-src-5.8.0/qtbase/config.tests/common/verifyspec

                            cd C:\SysGCC\qt-build\qtbase\config.tests\common\verifyspec && set MAKEFLAGS=&

                            C:/SysGCC/msys2/usr/bin/make clean && set MAKEFLAGS=& C:/SysGCC/msys2/usr/bin/make
                            rm -f verifyspec.obj
                            rm -f *~ core *.core

                            C:/SysGCC/Raspberry/bin/arm-linux-gnueabihf-g++ -c -march=armv8-a -mtune=cortex-a53 -mfpu=crypto-neon-fp-armv8 -mfloat-abi=hard --sysroot=C:/SysGCC/Raspberry/arm-linux-gnueabihf/sysroot -O2 -Wall -W -fPIC -IC:/SysGCC/qt-everywhere-opensource-src-5.8.0/qtbase/config.tests/common/verifyspec -I. -IC:/SysGCC/qt-everywhere-opensource-src-5.8.0/qtbase/mkspecs/devices/linux-rpi3-g++ -o verifyspec.obj C:/SysGCC/qt-everywhere-opensource-src-5.8.0/qtbase/config.tests/common/verifyspec/verifyspec.cpp

                            cc1plus.exe: error: bad value (armv8-a) for -march switch
                            cc1plus.exe: error: bad value (cortex-a53) for -mtune switch

                            C:/SysGCC/qt-everywhere-opensource-src-5.8.0/qtbase/config.tests/common/verifyspec/verifyspec.cpp:1:0: error: invalid floating point option: -mfpu=crypto-neon-fp-armv8

                            make: *** [Makefile:176: verifyspec.obj] Error 1

                            J H 2 Replies Last reply 6 Mar 2017, 06:23
                            0
                            • P pinballsp
                              5 Mar 2017, 20:52

                              .

                              Hello.

                              My before problem was because the firewall, already solved. I have follow instructions of lystate user, and all seem ok but fail in last step, with this error message.

                              Somebody know how to solve this problem to may compile ??

                              alt text

                              .

                              And this is the content of the config.log file:

                              executing config test use_gold_linker
                              cd C:\SysGCC\qt-build\qtbase\config.tests && C:/SysGCC/Raspberry/bin/arm-linux-gnueabihf-g++ -fuse-ld=gold -o conftest-out conftest.cpp
                              cc1plus.exe: error: unrecognized command line option '-fuse-ld=gold'

                              test config.qtbase.tests.use_gold_linker FAILED
                              executing config test verifyspec

                              cd C:\SysGCC\qt-build\qtbase\config.tests\common\verifyspec && C:\SysGCC\qt-build\qtbase\bin\qmake.exe -qtconf C:/SysGCC/qt-build/qtbase/bin/qt.conf "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared console" "QMAKE_CFLAGS += --sysroot=C:/SysGCC/Raspberry/arm-linux-gnueabihf/sysroot" "QMAKE_CXXFLAGS += --sysroot=C:/SysGCC/Raspberry/arm-linux-gnueabihf/sysroot" "QMAKE_LFLAGS += --sysroot=C:/SysGCC/Raspberry/arm-linux-gnueabihf/sysroot" C:/SysGCC/qt-everywhere-opensource-src-5.8.0/qtbase/config.tests/common/verifyspec

                              cd C:\SysGCC\qt-build\qtbase\config.tests\common\verifyspec && set MAKEFLAGS=& C:/SysGCC/msys2/usr/bin/make

                              C:/SysGCC/Raspberry/bin/arm-linux-gnueabihf-g++ -c -march=armv8-a -mtune=cortex-a53 -mfpu=crypto-neon-fp-armv8 -mfloat-abi=hard --sysroot=C:/SysGCC/Raspberry/arm-linux-gnueabihf/sysroot -O2 -Wall -W -fPIC -IC:/SysGCC/qt-everywhere-opensource-src-5.8.0/qtbase/config.tests/common/verifyspec -I. -IC:/SysGCC/qt-everywhere-opensource-src-5.8.0/qtbase/mkspecs/devices/linux-rpi3-g++ -o verifyspec.obj C:/SysGCC/qt-everywhere-opensource-src-5.8.0/qtbase/config.tests/common/verifyspec/verifyspec.cpp

                              cc1plus.exe: error: bad value (armv8-a) for -march switch
                              cc1plus.exe: error: bad value (cortex-a53) for -mtune switch

                              C:/SysGCC/qt-everywhere-opensource-src-5.8.0/qtbase/config.tests/common/verifyspec/verifyspec.cpp:1:0: error: invalid floating point option: -mfpu=crypto-neon-fp-armv8
                              make: *** [Makefile:176: verifyspec.obj] Error 1
                              executing config test verifyspec

                              cd C:\SysGCC\qt-build\qtbase\config.tests\common\verifyspec && C:\SysGCC\qt-build\qtbase\bin\qmake.exe -qtconf C:/SysGCC/qt-build/qtbase/bin/qt.conf "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared console" "QMAKE_CFLAGS += --sysroot=C:/SysGCC/Raspberry/arm-linux-gnueabihf/sysroot" "QMAKE_CXXFLAGS += --sysroot=C:/SysGCC/Raspberry/arm-linux-gnueabihf/sysroot" "QMAKE_LFLAGS += --sysroot=C:/SysGCC/Raspberry/arm-linux-gnueabihf/sysroot" C:/SysGCC/qt-everywhere-opensource-src-5.8.0/qtbase/config.tests/common/verifyspec

                              cd C:\SysGCC\qt-build\qtbase\config.tests\common\verifyspec && set MAKEFLAGS=&

                              C:/SysGCC/msys2/usr/bin/make clean && set MAKEFLAGS=& C:/SysGCC/msys2/usr/bin/make
                              rm -f verifyspec.obj
                              rm -f *~ core *.core

                              C:/SysGCC/Raspberry/bin/arm-linux-gnueabihf-g++ -c -march=armv8-a -mtune=cortex-a53 -mfpu=crypto-neon-fp-armv8 -mfloat-abi=hard --sysroot=C:/SysGCC/Raspberry/arm-linux-gnueabihf/sysroot -O2 -Wall -W -fPIC -IC:/SysGCC/qt-everywhere-opensource-src-5.8.0/qtbase/config.tests/common/verifyspec -I. -IC:/SysGCC/qt-everywhere-opensource-src-5.8.0/qtbase/mkspecs/devices/linux-rpi3-g++ -o verifyspec.obj C:/SysGCC/qt-everywhere-opensource-src-5.8.0/qtbase/config.tests/common/verifyspec/verifyspec.cpp

                              cc1plus.exe: error: bad value (armv8-a) for -march switch
                              cc1plus.exe: error: bad value (cortex-a53) for -mtune switch

                              C:/SysGCC/qt-everywhere-opensource-src-5.8.0/qtbase/config.tests/common/verifyspec/verifyspec.cpp:1:0: error: invalid floating point option: -mfpu=crypto-neon-fp-armv8

                              make: *** [Makefile:176: verifyspec.obj] Error 1

                              J Offline
                              J Offline
                              jsulm
                              Lifetime Qt Champion
                              wrote on 6 Mar 2017, 06:23 last edited by
                              #21

                              @pinballsp armv8-a? Shouldn't it be armv7 for RPi? Please show your configure call.

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

                              1 Reply Last reply
                              0
                              • A Offline
                                A Offline
                                ahmedawad
                                wrote on 12 Mar 2017, 07:41 last edited by ahmedawad 3 Dec 2017, 09:27
                                #22

                                @lygstate I followed your steps in details, but it looks like there is something wrong in step 10. My compilation terminates due to #include <EGL/egl.h> not found.

                                Please can you elaborate step 10 again. Inside the directory "qt-everywhere-opensource-src-5.8.0\qtbase\mkspecs" , there only exist "linux-arm-gnueabi-g++" and no other directory called "linux-arm-gnueabihf-g++" under that path found.
                                Is it the same to open "qt-everywhere-opensource-src-5.8.0\qtbase\mkspecs\linux-arm-gnueabi-g++\qmake.conf" and change every instance of arm-linux-gnueabi- with arm-linux-gnueabihf- ??

                                Any way the error I get is as follows:

                                ![alt text](0_1489304405176_upload-81c91e98-131a-4bbd-8fd1-dc35406c5dd6 image url)

                                Please did you go through all these steps and compiled 5.8 at the end ?

                                Thanks in advance

                                1 Reply Last reply
                                0
                                • K-StrK Offline
                                  K-StrK Offline
                                  K-Str
                                  wrote on 16 Jul 2017, 17:36 last edited by K-Str
                                  #23
                                  This post is deleted!
                                  1 Reply Last reply
                                  0
                                  • K-StrK Offline
                                    K-StrK Offline
                                    K-Str
                                    wrote on 22 Jul 2017, 10:42 last edited by
                                    #24

                                    @etiennedm ,
                                    thanks for this very good tutorial.
                                    It works without any problems and you can follow them without any modification.
                                    I would be happy if I can find such detailed description also for actual Qt5 for cross compiling on a Windows machine and other Qt5 topics!
                                    Kurt

                                    1 Reply Last reply
                                    0
                                    • M Offline
                                      M Offline
                                      megakoresh
                                      wrote on 30 Jul 2017, 20:35 last edited by megakoresh 8 Jan 2017, 11:47
                                      #25

                                      Hello, it appears this tutorial does not work with the QT version 5.9.1 due to the following error:

                                      S:/Development/qt-everywhere-opensource-src-591/qtbase/src/corelib/io/qsettings.cpp:965:40: error: 'KNOWNFOLDERID' does not name a type
                                      S:/Development/qt-everywhere-opensource-src-591/qtbase/src/corelib/io/qsettings.cpp:965:55: error: ISO C++ forbids declaration of 'type' with no type [-fpermissive]
                                      S:/Development/qt-everywhere-opensource-src-591/qtbase/src/corelib/io/qsettings.cpp: In function 'QString windowsConfigPath(const int&)':
                                      S:/Development/qt-everywhere-opensource-src-591/qtbase/src/corelib/io/qsettings.cpp:970:53: error: 'SHGetKnownFolderPath' was not declared in this scope
                                      S:/Development/qt-everywhere-opensource-src-591/qtbase/src/corelib/io/qsettings.cpp:976:21: error: 'FOLDERID_ProgramData' was not declared in this scope
                                      S:/Development/qt-everywhere-opensource-src-591/qtbase/src/corelib/io/qsettings.cpp:978:28: error: 'FOLDERID_RoamingAppData' was not declared in this scope
                                      S:/Development/qt-everywhere-opensource-src-591/qtbase/src/corelib/io/qsettings.cpp: In function 'void initDefaultPaths(QMutexLocker*)':
                                      S:/Development/qt-everywhere-opensource-src-591/qtbase/src/corelib/io/qsettings.cpp:1080:64: error: 'FOLDERID_RoamingAppData' was not declared in this scope
                                      S:/Development/qt-everywhere-opensource-src-591/qtbase/src/corelib/io/qsettings.cpp:1081:61: error: 'FOLDERID_ProgramData' was not declared in this scope
                                      

                                      So I tried with version 5.6.2 and that one works until step 16 - since I need OpenGL and libxcb, I can't omit them, and then I get the error that OpenGL is missing:

                                      The OpenGL ES 2.0 functionality test failed!
                                       Use of pkg-config is not enabled, maybe you want to pass -pkg-config?
                                       You might need to modify the include and library search paths by editing
                                       QMAKE_INCDIR_OPENGL_ES2, QMAKE_LIBDIR_OPENGL_ES2 and QMAKE_LIBS_OPENGL_ES2 in
                                       S:/Development/qt-everywhere-opensource-src-562/qtbase/mkspecs/devices/linux-rpi3-g++.
                                      

                                      From my understanding, judging from the -v option output, it's trying to include a file gl2.h, but failing:

                                      S:/Development/SysGCC/Raspberry/bin/arm-linux-gnueabihf-g++ -c -march=armv8-a -mtune=cortex-a53 -mfpu=crypto-neon-fp-armv8 -mfloat-abi=hard --sysroot=S:/Development/SysGCC/Raspbery/arm-linux-gnueabihf/sysroot -g -std=gnu++0x -Wall -W -fPIC  -I. -I/opt/vc/include -I/opt/vc/include/GLES2 -I/opt/vc/include/GLES -I/opt/vc/include/EGL -I/opt/vc/include/vcinclude -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux -I../../../mkspecs/devices/linux-rpi3-g++ -o opengles2.obj opengles2.cpp
                                      opengles2.cpp:37:25: fatal error: GLES2/gl2.h: No such file or directory
                                         #include <GLES2/gl2.h>
                                      

                                      However, the file actually does exit as the sysroot: alt text

                                      Looking at the internet for 2 days, it appears that proper cross-compilation of QT from Windows to Raspberry is literally just impossible. Or am I missing something?

                                      EDIT: The tutorial says to replace MinGW with MinGW64 with GCC 4.9>=, but the sysprogs website only has one with 4.6. I went to MinGW site to obtain the latest, but that one has some strange parameters in the installer (sjsj??) I don't know what to set there.

                                      EDIT#2:
                                      I managed to get the build to completion by replacing SysProg's synchronization with rsync using Windows 10 Bash and by manually installing the latest version of MinGW64 instead of using SysProgs installer. Manually rsyncing using the following command seemed to have resolved the symlink mess (need to cd to parent of sysroot first):

                                      RSYNC_OPTS='-rtkLDvz --no-specials --no-devices'
                                      sshpass -p $RSYNC_PASSWORD rsync $RSYNC_OPTS pi@$R_HOST:/lib sysroot && \
                                      sshpass -p $RSYNC_PASSWORD rsync $RSYNC_OPTS pi@$R_HOST:/usr/include sysroot/usr && \
                                      sshpass -p $RSYNC_PASSWORD rsync $RSYNC_OPTS pi@$R_HOST:/usr/lib sysroot/usr && \
                                      sshpass -p $RSYNC_PASSWORD rsync $RSYNC_OPTS pi@$R_HOST:/usr/share/X11 sysroot/usr/share && \
                                      sshpass -p $RSYNC_PASSWORD rsync $RSYNC_OPTS pi@$R_HOST:/opt/vc sysroot/opt
                                      

                                      Where RSYNC_PASSWORD is the password to your raspberry host.
                                      However after running the build, I looked into the qt5 directory and saw Windows .exe files in there instead of qmake that raspberry can use. Then I couldn't get the QT Creator to work with that toolchain because it just didnt detect the qmake (ofc it didnt theres a windows .exe in there instead!). So any suggestions? The final configure call before I run make && make install is:

                                      ../../qt-everywhere-opensource-src-5.6.2/qtbase/configure -platform win32-g++ -xplatform linux-arm-gnueabi-g++ -release -device linux-rpi3-g++ -sysroot E:/SysGCC/Raspberry/arm-linux-gnueabihf/sysroot -prefix /usr/local/qt5 -device-option CROSS_COMPILE=E:/SysGCC/Raspberry/bin/arm-linux-gnueabihf- -nomake examples -opensource -confirm-license -opengl es2
                                      

                                      (Drive is different since its another PC)

                                      EDIT#3
                                      From the limited amount of information online about this, it seems like qmake is not required on target since the package is a runnable binary, and at first glance the QtCreator CAN build my package, however it can not deploy and it can not debug. And when I manually rsync-ed the app binary to the raspberry and tried to run it, it gave me a bunch of strange errors like Qt_5 is not defined in some header, etc. and didn't run. But the binary is at least in the correct format to run at raspberry so at least the cross compiler worked. Can someone help me get that Qt Creator and GDB setup?

                                      EDIT#4
                                      I managed to solve the problem by setting an env variable in bashrc to point to the qt installation, then it started complaining about some plugin that failed to load, so I had to add the plugin variable, and then finally the font variable:

                                      export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/qt5/lib
                                      export QT_PLUGIN_PATH=/usr/local/qt5/plugins
                                      export QT_QWS_FONTDIR=/usr/local/qt5/lib/fonts
                                      

                                      Now the app complains a different thing:

                                      qt.qpa.egldeviceintegration: Failed to load EGL device integration "eglfs_brcm"
                                      Could not open egl display
                                      Aborted
                                      

                                      If I start the app using ./app -platform linuxfb it works, but looks horrible, lags and has some strange graphical artifacts whenever I change window position.

                                      EDIT#5:
                                      After I disabled the desktop login, like the SysProgs tutorial suggests, I set the app to start using the following command

                                      /usr/bin/startx /home/pi/app -platform linuxfb
                                      

                                      so the opengl stuff still doesn't work (cant find display, I suspect this is a system configuration problem), but without the desktop running, the app looks fine (we have no intensive graphics anyway). In QT Creator make sure its set to login to device as root (and enable root login over ssh on your development raspberry), then set deployment to a custom command, set the command to /usr/bin/startx and everything that comes after that (/home/pi/app -platform linuxfb) as arguments. Then QT should be able to deploy the app. Now the problem is with debugger, as QT can not use the toolchain debugger due to no pythin support. I have to build it myself. When I manage to do that, I try to document the full process and link it here.

                                      1 Reply Last reply
                                      0
                                      • P pinballsp
                                        5 Mar 2017, 20:52

                                        .

                                        Hello.

                                        My before problem was because the firewall, already solved. I have follow instructions of lystate user, and all seem ok but fail in last step, with this error message.

                                        Somebody know how to solve this problem to may compile ??

                                        alt text

                                        .

                                        And this is the content of the config.log file:

                                        executing config test use_gold_linker
                                        cd C:\SysGCC\qt-build\qtbase\config.tests && C:/SysGCC/Raspberry/bin/arm-linux-gnueabihf-g++ -fuse-ld=gold -o conftest-out conftest.cpp
                                        cc1plus.exe: error: unrecognized command line option '-fuse-ld=gold'

                                        test config.qtbase.tests.use_gold_linker FAILED
                                        executing config test verifyspec

                                        cd C:\SysGCC\qt-build\qtbase\config.tests\common\verifyspec && C:\SysGCC\qt-build\qtbase\bin\qmake.exe -qtconf C:/SysGCC/qt-build/qtbase/bin/qt.conf "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared console" "QMAKE_CFLAGS += --sysroot=C:/SysGCC/Raspberry/arm-linux-gnueabihf/sysroot" "QMAKE_CXXFLAGS += --sysroot=C:/SysGCC/Raspberry/arm-linux-gnueabihf/sysroot" "QMAKE_LFLAGS += --sysroot=C:/SysGCC/Raspberry/arm-linux-gnueabihf/sysroot" C:/SysGCC/qt-everywhere-opensource-src-5.8.0/qtbase/config.tests/common/verifyspec

                                        cd C:\SysGCC\qt-build\qtbase\config.tests\common\verifyspec && set MAKEFLAGS=& C:/SysGCC/msys2/usr/bin/make

                                        C:/SysGCC/Raspberry/bin/arm-linux-gnueabihf-g++ -c -march=armv8-a -mtune=cortex-a53 -mfpu=crypto-neon-fp-armv8 -mfloat-abi=hard --sysroot=C:/SysGCC/Raspberry/arm-linux-gnueabihf/sysroot -O2 -Wall -W -fPIC -IC:/SysGCC/qt-everywhere-opensource-src-5.8.0/qtbase/config.tests/common/verifyspec -I. -IC:/SysGCC/qt-everywhere-opensource-src-5.8.0/qtbase/mkspecs/devices/linux-rpi3-g++ -o verifyspec.obj C:/SysGCC/qt-everywhere-opensource-src-5.8.0/qtbase/config.tests/common/verifyspec/verifyspec.cpp

                                        cc1plus.exe: error: bad value (armv8-a) for -march switch
                                        cc1plus.exe: error: bad value (cortex-a53) for -mtune switch

                                        C:/SysGCC/qt-everywhere-opensource-src-5.8.0/qtbase/config.tests/common/verifyspec/verifyspec.cpp:1:0: error: invalid floating point option: -mfpu=crypto-neon-fp-armv8
                                        make: *** [Makefile:176: verifyspec.obj] Error 1
                                        executing config test verifyspec

                                        cd C:\SysGCC\qt-build\qtbase\config.tests\common\verifyspec && C:\SysGCC\qt-build\qtbase\bin\qmake.exe -qtconf C:/SysGCC/qt-build/qtbase/bin/qt.conf "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared console" "QMAKE_CFLAGS += --sysroot=C:/SysGCC/Raspberry/arm-linux-gnueabihf/sysroot" "QMAKE_CXXFLAGS += --sysroot=C:/SysGCC/Raspberry/arm-linux-gnueabihf/sysroot" "QMAKE_LFLAGS += --sysroot=C:/SysGCC/Raspberry/arm-linux-gnueabihf/sysroot" C:/SysGCC/qt-everywhere-opensource-src-5.8.0/qtbase/config.tests/common/verifyspec

                                        cd C:\SysGCC\qt-build\qtbase\config.tests\common\verifyspec && set MAKEFLAGS=&

                                        C:/SysGCC/msys2/usr/bin/make clean && set MAKEFLAGS=& C:/SysGCC/msys2/usr/bin/make
                                        rm -f verifyspec.obj
                                        rm -f *~ core *.core

                                        C:/SysGCC/Raspberry/bin/arm-linux-gnueabihf-g++ -c -march=armv8-a -mtune=cortex-a53 -mfpu=crypto-neon-fp-armv8 -mfloat-abi=hard --sysroot=C:/SysGCC/Raspberry/arm-linux-gnueabihf/sysroot -O2 -Wall -W -fPIC -IC:/SysGCC/qt-everywhere-opensource-src-5.8.0/qtbase/config.tests/common/verifyspec -I. -IC:/SysGCC/qt-everywhere-opensource-src-5.8.0/qtbase/mkspecs/devices/linux-rpi3-g++ -o verifyspec.obj C:/SysGCC/qt-everywhere-opensource-src-5.8.0/qtbase/config.tests/common/verifyspec/verifyspec.cpp

                                        cc1plus.exe: error: bad value (armv8-a) for -march switch
                                        cc1plus.exe: error: bad value (cortex-a53) for -mtune switch

                                        C:/SysGCC/qt-everywhere-opensource-src-5.8.0/qtbase/config.tests/common/verifyspec/verifyspec.cpp:1:0: error: invalid floating point option: -mfpu=crypto-neon-fp-armv8

                                        make: *** [Makefile:176: verifyspec.obj] Error 1

                                        H Offline
                                        H Offline
                                        hervir
                                        wrote on 29 Dec 2017, 20:13 last edited by
                                        #26

                                        @pinballsp I am having the same problem. Did you find a way to solve it?

                                        T 1 Reply Last reply 26 Jan 2020, 01:47
                                        0
                                        • C Offline
                                          C Offline
                                          Csaba911
                                          wrote on 30 Jul 2019, 18:23 last edited by
                                          #27

                                          This is just gibberish, its mindboggling that there is no option it Qt5 to add raspberry and it will install all option/setting its required.
                                          Linux and Qt is so discouraging to use it, I don't understand people and their mind, either this instructions are written poorly or just always assuming that the person will understand what being told.
                                          Instruction provided here is extremely disorganized and actually not working, maybe it was working when it was created but not now.

                                          J 1 Reply Last reply 31 Jul 2019, 05:39
                                          2

                                          • Login

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