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. Qt build for Raspberry Pi 3 on Windows 10 using mingw32, gcc and raspberry-gcc6.3.0-r3 fails
Forum Updated to NodeBB v4.3 + New Features

Qt build for Raspberry Pi 3 on Windows 10 using mingw32, gcc and raspberry-gcc6.3.0-r3 fails

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
22 Posts 3 Posters 7.1k 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.
  • NapiN Napi

    @koahnig
    Yup, cross-compile worked without an error. I wrote a simple app in order to test if the compiler works before I started building Qt.

    #include <stdio.h>
    
    int main()
    {
      printf("Hello world! \n");
      return 0;
    }
    

    And the make file on my Windows host.

    
    all:
    	arm-linux-gnueabihf-g++.exe -ggdb main.cpp -o main
    clean:
    	rm main
    

    App works fine on the Raspberry Pi.

    K Offline
    K Offline
    koahnig
    wrote on last edited by koahnig
    #7

    @Napi

    That is good.

    You have copied the required dynamic link libs to RPi?

    I have basically the cross-compiled folder to my embedded board. Eventually you need to set a path for your application to find the dynamic link libs. I have set

    export LD_LIBRARY_PATH=/home/ubuntu/QtForBBB/lib:. 
    

    Not sure if the structure could be the same on your board. I have done on Beagle Bone Black.

    Also I have done the cross-compile on Linux Ubuntu desktop with VirtualBox, because the cross-compiler for windows I did not get to work.

    Vote the answer(s) that helped you to solve your issue(s)

    1 Reply Last reply
    1
    • NapiN Offline
      NapiN Offline
      Napi
      wrote on last edited by
      #8

      @koahnig

      I copied the complete install folder:

      pi@raspberrypi:/usr/local/qt5 $ ls
      bin  doc  include  lib  plugins  qml  translations
      

      I also tried to set the path for my app, as you suggested:

      export LD_LIBRARY_PATH=/usr/local/qt5/lib:.
      

      But I am still getting the same message:

      pi@raspberrypi:/usr/local/qt5/bin $ ./qtdiag
      Illegal instruction
      
      1 Reply Last reply
      0
      • NapiN Offline
        NapiN Offline
        Napi
        wrote on last edited by
        #9

        @koahnig

        It looks like the libs get loaded but there is something wrong with libQt5Core.

        gdb qtdiag
        GNU gdb (Raspbian 7.12-6) 7.12.0.20161007-git
        Copyright (C) 2016 Free Software Foundation, Inc.
        License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
        This is free software: you are free to change and redistribute it.
        There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
        and "show warranty" for details.
        This GDB was configured as "arm-linux-gnueabihf".
        Type "show configuration" for configuration details.
        For bug reporting instructions, please see:
        <http://www.gnu.org/software/gdb/bugs/>.
        Find the GDB manual and other documentation resources online at:
        <http://www.gnu.org/software/gdb/documentation/>.
        For help, type "help".
        Type "apropos word" to search for commands related to "word"...
        Reading symbols from qtdiag...(no debugging symbols found)...done.
        (gdb) r
        Starting program: /usr/local/qt5/bin/qtdiag 
        [Thread debugging using libthread_db enabled]
        Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
        
        Program received signal SIGILL, Illegal instruction.
        0xb610cb30 in qRegisterResourceData(int, unsigned char const*, unsigned char const*, unsign
        ed char const*) () from /usr/local/qt5/lib/libQt5Core.so.5
        
        K 1 Reply Last reply
        0
        • NapiN Napi

          @koahnig

          It looks like the libs get loaded but there is something wrong with libQt5Core.

          gdb qtdiag
          GNU gdb (Raspbian 7.12-6) 7.12.0.20161007-git
          Copyright (C) 2016 Free Software Foundation, Inc.
          License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
          This is free software: you are free to change and redistribute it.
          There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
          and "show warranty" for details.
          This GDB was configured as "arm-linux-gnueabihf".
          Type "show configuration" for configuration details.
          For bug reporting instructions, please see:
          <http://www.gnu.org/software/gdb/bugs/>.
          Find the GDB manual and other documentation resources online at:
          <http://www.gnu.org/software/gdb/documentation/>.
          For help, type "help".
          Type "apropos word" to search for commands related to "word"...
          Reading symbols from qtdiag...(no debugging symbols found)...done.
          (gdb) r
          Starting program: /usr/local/qt5/bin/qtdiag 
          [Thread debugging using libthread_db enabled]
          Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
          
          Program received signal SIGILL, Illegal instruction.
          0xb610cb30 in qRegisterResourceData(int, unsigned char const*, unsigned char const*, unsign
          ed char const*) () from /usr/local/qt5/lib/libQt5Core.so.5
          
          K Offline
          K Offline
          koahnig
          wrote on last edited by
          #10

          @Napi

          The only idea Ihave at the time being would be to create a simple console app based on the creator template and do also a simple hello world output. This would be very basic again, but also involve a minimum Qt.

          When it fails too, there is something fundamental with Qt cross-compile.

          As explained before, all this is outside of my experience. I am trying to get someone else interested to have a look here.

          Vote the answer(s) that helped you to solve your issue(s)

          1 Reply Last reply
          0
          • NapiN Offline
            NapiN Offline
            Napi
            wrote on last edited by Napi
            #11

            @koahnig

            Thank you so much for your help so far!
            I think I am going to start by only building qt-base, which I am then going to use as a starting point for a simple app.

            Here is a link with the exact steps I did, just in case Iink.

            K 1 Reply Last reply
            0
            • NapiN Napi

              @koahnig

              Thank you so much for your help so far!
              I think I am going to start by only building qt-base, which I am then going to use as a starting point for a simple app.

              Here is a link with the exact steps I did, just in case Iink.

              K Offline
              K Offline
              koahnig
              wrote on last edited by
              #12

              @Napi

              Certainly stepping back in complexity shall help.

              The cross-compile on Windows for linux and/or embedded linux is possible, but requires a bit more steam to get around all the obstacles.

              Vote the answer(s) that helped you to solve your issue(s)

              1 Reply Last reply
              0
              • NapiN Offline
                NapiN Offline
                Napi
                wrote on last edited by
                #13

                @koahnig
                So I managed to compile qtBase, but now it seems that dependencies are missing. I was trying to run
                ./examples/gui/analogclock/analogclock , this is the error message I get:

                qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""
                qt.qpa.plugin: Could not find the Qt platform plugin "eglfs" in ""
                This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
                

                I tried the following:

                export QT_QPA_PLATFORM=eglfs
                export QT_QPA_PLATFORM_PLUGIN_PATH=/usr/local/qt5/plugins/platforms
                export LD_LIBRARY_PATH=/usr/local/qt5/lib
                sudo ldconfig
                
                K 1 Reply Last reply
                0
                • NapiN Napi

                  @koahnig
                  So I managed to compile qtBase, but now it seems that dependencies are missing. I was trying to run
                  ./examples/gui/analogclock/analogclock , this is the error message I get:

                  qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""
                  qt.qpa.plugin: Could not find the Qt platform plugin "eglfs" in ""
                  This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
                  

                  I tried the following:

                  export QT_QPA_PLATFORM=eglfs
                  export QT_QPA_PLATFORM_PLUGIN_PATH=/usr/local/qt5/plugins/platforms
                  export LD_LIBRARY_PATH=/usr/local/qt5/lib
                  sudo ldconfig
                  
                  K Offline
                  K Offline
                  koahnig
                  wrote on last edited by
                  #14

                  @Napi

                  Try to compile a very basic program using Qt. Use the Qt console template fromQt creator and compile and run on RPi without any modifications. This should work IMHO.

                  Are you using Qt creator?

                  When the very basic console application does not work, you have fundamental issue there. From having no additions at all, you can implement complexity step-by-step (e.g. qDebug() and so on).

                  Afterwards you can worry about the additional modules required. The problem is that this might become quite tedious.

                  Vote the answer(s) that helped you to solve your issue(s)

                  1 Reply Last reply
                  1
                  • NapiN Offline
                    NapiN Offline
                    Napi
                    wrote on last edited by Napi
                    #15

                    @koahnig

                    So I did a build using the Qt Creator and the Qt Console Application template and it worked fine.

                    I also tried the AnalogClock example afterwards, whit no success. There might be some issue with OpenGl or the renderer in general.

                    Update: I got the example running !!!!!! Yeah !!! I did a rebuild off the whole qt base without using the batch file for configuring!

                    0_1543789077149_572b9752-2c6f-45de-bfe5-3d4f586c03f4-image.png

                    1 Reply Last reply
                    0
                    • NapiN Offline
                      NapiN Offline
                      Napi
                      wrote on last edited by
                      #16

                      So one issue that I have now is the fact that some paths on the raspberry qt build are wrong, someting wasn't right during configuring. This is the error I get running the 2dpainting example.

                      0_1543807841441_2a7eb842-ab8d-4e51-9dec-961d9a4f1dc0-image.png

                      The interesting thing here is, that QFontDatabase url is strange, I ran the following configure command:

                      ../qt-everywhere-src-5.11.2/qtbase/configure -platform win32-g++ -device linux-rasp-pi-g++ -release -sysroot C:/SysGCC/raspberry/arm-linux-gnueabihf/sysroot -prefix /usr/local/qt5 -device-option "CROSS_COMPILE=arm-linux-gnueabihf-" -opensource -confirm-license -opengl es2 -no-use-gold-linker -make libs
                      
                      K 2 Replies Last reply
                      0
                      • NapiN Napi

                        So one issue that I have now is the fact that some paths on the raspberry qt build are wrong, someting wasn't right during configuring. This is the error I get running the 2dpainting example.

                        0_1543807841441_2a7eb842-ab8d-4e51-9dec-961d9a4f1dc0-image.png

                        The interesting thing here is, that QFontDatabase url is strange, I ran the following configure command:

                        ../qt-everywhere-src-5.11.2/qtbase/configure -platform win32-g++ -device linux-rasp-pi-g++ -release -sysroot C:/SysGCC/raspberry/arm-linux-gnueabihf/sysroot -prefix /usr/local/qt5 -device-option "CROSS_COMPILE=arm-linux-gnueabihf-" -opensource -confirm-license -opengl es2 -no-use-gold-linker -make libs
                        
                        K Offline
                        K Offline
                        koahnig
                        wrote on last edited by
                        #17

                        @Napi

                        Congrats for your progress.

                        You are right that the URL is strange.
                        I have just scanned through the source of Qt5.11.2 as shipped with a MinGW pre-built. The given text is part of c:\Qt\5.11.2\Src\qtbase\src\platformsupport\fontdatabases\freetype\qfreetypefontdatabase.cpp

                        However opening the URL brings up a site with that name, but it is not really what I expected. First of all it is in French and it does not hold direct information with respect to fonts.

                        Vote the answer(s) that helped you to solve your issue(s)

                        1 Reply Last reply
                        0
                        • NapiN Napi

                          So one issue that I have now is the fact that some paths on the raspberry qt build are wrong, someting wasn't right during configuring. This is the error I get running the 2dpainting example.

                          0_1543807841441_2a7eb842-ab8d-4e51-9dec-961d9a4f1dc0-image.png

                          The interesting thing here is, that QFontDatabase url is strange, I ran the following configure command:

                          ../qt-everywhere-src-5.11.2/qtbase/configure -platform win32-g++ -device linux-rasp-pi-g++ -release -sysroot C:/SysGCC/raspberry/arm-linux-gnueabihf/sysroot -prefix /usr/local/qt5 -device-option "CROSS_COMPILE=arm-linux-gnueabihf-" -opensource -confirm-license -opengl es2 -no-use-gold-linker -make libs
                          
                          K Offline
                          K Offline
                          koahnig
                          wrote on last edited by koahnig
                          #18

                          @Napi

                          Some information from Qt on fondconfig https://doc.qt.io/qt-5/qt-embedded-fonts.html

                          Here is a Qt reference to dejavu fonts http://doc-snapshots.qt.io/qt5-5.12/qtgui-attribution-dejayvu.html
                          This points to https://dejavu-fonts.github.io/ which makes sense compared to the strange URL.

                          [edit: koahnig form here]
                          Digging a bit deeper and checked current Qt5.12.0 source holding this:

                              if (!dir.exists()) {
                                  qWarning("QFontDatabase: Cannot find font directory %s.\n"
                                           "Note that Qt no longer ships fonts. Deploy some (from https://dejavu-fonts.github.io/ for example) or switch to fontconfig.",
                                           qPrintable(fontpath));
                                  return;
                          

                          In up-coming release the correct link is referenced.

                          Vote the answer(s) that helped you to solve your issue(s)

                          1 Reply Last reply
                          0
                          • K Offline
                            K Offline
                            koahnig
                            wrote on last edited by
                            #19

                            Also the source contained in today's release Qt5.11.3 has the github.io reference. Checked with MinGW pre-built.

                            Vote the answer(s) that helped you to solve your issue(s)

                            NapiN 1 Reply Last reply
                            0
                            • K koahnig

                              Also the source contained in today's release Qt5.11.3 has the github.io reference. Checked with MinGW pre-built.

                              NapiN Offline
                              NapiN Offline
                              Napi
                              wrote on last edited by
                              #20

                              @koahnig

                              I am trying version 5.12.0 now. Thank you!

                              1 Reply Last reply
                              0
                              • F Offline
                                F Offline
                                FluxDice
                                wrote on last edited by
                                #21

                                @koahnig and @Napi
                                I am somewhat of a noob and looking this work. Are there instructions you followed to the get this to work?

                                Thank you very much for you help.

                                K 1 Reply Last reply
                                0
                                • F FluxDice

                                  @koahnig and @Napi
                                  I am somewhat of a noob and looking this work. Are there instructions you followed to the get this to work?

                                  Thank you very much for you help.

                                  K Offline
                                  K Offline
                                  koahnig
                                  wrote on last edited by
                                  #22

                                  @FluxDice

                                  Hi and welcome to devnet forum

                                  Here is a link to the Qt documentation for cross compiling.
                                  https://doc.qt.io/qt-5/embedded-linux.html

                                  For raspberry specifically there is also https://www.raspberrypi.org/forums/viewtopic.php?t=204778

                                  Vote the answer(s) that helped you to solve your issue(s)

                                  1 Reply Last reply
                                  1

                                  • Login

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