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 RPi application using Qt Creator
Forum Updated to NodeBB v4.3 + New Features

Cross-compiling RPi application using Qt Creator

Scheduled Pinned Locked Moved Unsolved QtonPi
30 Posts 3 Posters 8.2k 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.
  • P Pavel_47
    27 May 2019, 15:32

    Hello,
    On this link there is a manual on how to cross-compile RPi applications using Visual Studio:
    Creating a Qt-Embedded app for Raspberry Pi
    Can I find a similar manual on using Qt Creator instead of Visual Studio ?
    Thanks.

    P Offline
    P Offline
    Pablo J. Rogina
    wrote on 27 May 2019, 16:26 last edited by
    #2

    @Pavel_47 you may want to try this guide, in particular the section to setup Qt Creator

    Upvote the answer(s) that helped you solve the issue
    Use "Topic Tools" button to mark your post as Solved
    Add screenshots via postimage.org
    Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

    P 1 Reply Last reply 31 May 2019, 08:07
    2
    • P Offline
      P Offline
      Pavel_47
      wrote on 28 May 2019, 08:06 last edited by
      #3

      Hello,
      I plan to use Windows machine for that.
      Does exist similar manual that elaborates flow for windows host ?
      Thanks.

      P 1 Reply Last reply 28 May 2019, 11:43
      0
      • P Pavel_47
        28 May 2019, 08:06

        Hello,
        I plan to use Windows machine for that.
        Does exist similar manual that elaborates flow for windows host ?
        Thanks.

        P Offline
        P Offline
        Pablo J. Rogina
        wrote on 28 May 2019, 11:43 last edited by
        #4

        @Pavel_47 said in Cross-compiling RPi application using Qt Creator:

        I plan to use Windows machine for that.

        Ok, not a good idea in my opinion... You may want to use a VM with Linux instead.

        Given that said, and assuming that you already setup the cross-compiling environment on Windows per this guide (it's related to the guide you mentioned in your first post) then setting up Qt Creator to use such cross-compiling toolchain/environment can be followed from the guide I pointed out. At Qt Creator level, it's most the same (obviously the paths will change slightly...). Good luck.

        Upvote the answer(s) that helped you solve the issue
        Use "Topic Tools" button to mark your post as Solved
        Add screenshots via postimage.org
        Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

        1 Reply Last reply
        0
        • P Offline
          P Offline
          Pavel_47
          wrote on 28 May 2019, 12:08 last edited by
          #5

          For building windows tools, manual specifies the following command:

          mkdir qt-build
          cd qt-build
          ../qt-everywhere-opensource-src-5.5.0/configure -platform win32-g++ -xplatform linux-arm-gnueabi-g++ -release -opengl es2 -device linux-rasp-pi2-g++ -sysroot C:/SysGCC/Raspberry/arm-linux-gnueabihf/sysroot -prefix /usr/local/qt5
          

          For RPi3 device I should probably use linux-rasp-pi-g++ instead of linux-rasp-pi2-g++. Correct ?

          1 Reply Last reply
          0
          • P Offline
            P Offline
            Pavel_47
            wrote on 28 May 2019, 12:58 last edited by
            #6

            Here is the message what I get after executing build command:

            The OpenGL ES 2.0 functionality test failed!
             Use of pkg-config is not enabled, maybe you want to pass -force-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
             c:/Users/pyo/Downloads/qt-everywhere-opensource-src-5.5.0/qtbase/mkspecs/devices/linux-rasp-pi-g++.
            

            Any ideas ?

            1 Reply Last reply
            0
            • S Offline
              S Offline
              sierdzio
              Moderators
              wrote on 28 May 2019, 13:07 last edited by
              #7

              Device should be linux-rasp-pi3-g++ or if you want EGLFS with full OpenGL support, linux-rasp-pi3-vc4-g++

              (Z(:^

              1 Reply Last reply
              0
              • P Offline
                P Offline
                Pavel_47
                wrote on 28 May 2019, 13:13 last edited by
                #8

                With linux-rasp-pi3-g++ I get this:
                Error: No device matching 'linux-rasp-pi3-g++'

                1 Reply Last reply
                0
                • P Offline
                  P Offline
                  Pavel_47
                  wrote on 28 May 2019, 13:23 last edited by
                  #9

                  alt text

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    sierdzio
                    Moderators
                    wrote on 28 May 2019, 17:05 last edited by
                    #10

                    Oh, Qt 5.5? Yes, that came out before Raspberry Pi 3 was on the market. I strongly recommend compiling a more modern version of Qt. Even Raspbian OS (which is veeery outdated) ships Qt 5.7...

                    (Z(:^

                    1 Reply Last reply
                    0
                    • P Offline
                      P Offline
                      Pavel_47
                      wrote on 28 May 2019, 17:25 last edited by
                      #11

                      I took source from here:
                      qt-everywhere-src-5.12.3
                      Can you provide link with more recent version.
                      Thanks

                      P 1 Reply Last reply 28 May 2019, 17:33
                      0
                      • P Pavel_47
                        28 May 2019, 17:25

                        I took source from here:
                        qt-everywhere-src-5.12.3
                        Can you provide link with more recent version.
                        Thanks

                        P Offline
                        P Offline
                        Pablo J. Rogina
                        wrote on 28 May 2019, 17:33 last edited by
                        #12

                        @Pavel_47 that's latest version so far

                        please be aware that a previous post from you has ../qt-everywhere-opensource-src-5.5.0/configure that's why I think @sierdzio brought that out.

                        Upvote the answer(s) that helped you solve the issue
                        Use "Topic Tools" button to mark your post as Solved
                        Add screenshots via postimage.org
                        Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

                        1 Reply Last reply
                        0
                        • P Offline
                          P Offline
                          Pavel_47
                          wrote on 28 May 2019, 17:38 last edited by
                          #13

                          So, what about original problem: what location use in bulding command - linux-rasp-pi-g++ or linux-rasp-pi2-g++ ?

                          S 1 Reply Last reply 29 May 2019, 12:02
                          0
                          • P Pavel_47
                            28 May 2019, 17:38

                            So, what about original problem: what location use in bulding command - linux-rasp-pi-g++ or linux-rasp-pi2-g++ ?

                            S Offline
                            S Offline
                            sierdzio
                            Moderators
                            wrote on 29 May 2019, 12:02 last edited by
                            #14

                            @Pavel_47 said in Cross-compiling RPi application using Qt Creator:

                            So, what about original problem: what location use in bulding command - linux-rasp-pi-g++ or linux-rasp-pi2-g++ ?

                            All your input so far suggest you are actually compiling Qt 5.5. Please make sure you're working with the 5.12.3 source you downloaded.

                            (Z(:^

                            1 Reply Last reply
                            0
                            • P Offline
                              P Offline
                              Pavel_47
                              wrote on 29 May 2019, 14:00 last edited by
                              #15

                              Yes !!! Misunderstanding with my colleague - I believed that folder qt-everywhere-opensource-src-5.5.0 corresponds to the latest source of Qt. Indeed there are new device folder that correspond to RPi3: linux-rasp-pi3-g++ and linux-rasp-pi3-vc4-g++. What is the difference between them ?
                              Thanks.

                              P 1 Reply Last reply 29 May 2019, 14:17
                              0
                              • P Pavel_47
                                29 May 2019, 14:00

                                Yes !!! Misunderstanding with my colleague - I believed that folder qt-everywhere-opensource-src-5.5.0 corresponds to the latest source of Qt. Indeed there are new device folder that correspond to RPi3: linux-rasp-pi3-g++ and linux-rasp-pi3-vc4-g++. What is the difference between them ?
                                Thanks.

                                P Offline
                                P Offline
                                Pavel_47
                                wrote on 29 May 2019, 14:17 last edited by
                                #16

                                @Pavel_47 Ok, I see - OpenGL support

                                1 Reply Last reply
                                0
                                • P Offline
                                  P Offline
                                  Pavel_47
                                  wrote on 29 May 2019, 14:27 last edited by
                                  #17

                                  Error while building !

                                  Preparing build tree...
                                  Creating qmake...
                                  ..............................c:/Users/pyo/Downloads/qt-everywhere-src-5.12.3/qtbase/src/corelib/global/qglobal.cpp:
                                  In function 'QString qEnvironmentVariable(const char*, const QString&)':
                                  c:/Users/pyo/Downloads/qt-everywhere-src-5.12.3/qtbase/src/corelib/global/qglobal.cpp:3346:49: error: '_wgetenv_s' was not declared in this scope
                                       _wgetenv_s(&requiredSize, 0, 0, wname.data());
                                                                                   ^
                                  make.exe: *** [qglobal.o] Error 1
                                  
                                  1 Reply Last reply
                                  0
                                  • P Offline
                                    P Offline
                                    Pavel_47
                                    wrote on 29 May 2019, 14:44 last edited by
                                    #18

                                    Indeed, I've hierarchically searched for _wgetenv_s through whole qt-everywhere-src-5.12.3 (.cpp and .h) and found that it's referenced only in qglobal.cpp ... and declared/defined nowhere.

                                    1 Reply Last reply
                                    0
                                    • P Offline
                                      P Offline
                                      Pavel_47
                                      wrote on 29 May 2019, 15:08 last edited by
                                      #19

                                      On this link the author propose a workaround (although I'm not sure if this workaround is valid for my case).
                                      Anyway I've added this instruction (i.e. defined MINGW_HAS_SECURE_API flag as suggested)
                                      DEFINES += UNICODE _UNICODE WIN32 MINGW_HAS_SECURE_API=1
                                      in ...\win32-g++\qmake.conf
                                      Unfortunately it didn't help

                                      1 Reply Last reply
                                      0
                                      • P Offline
                                        P Offline
                                        Pavel_47
                                        wrote on 29 May 2019, 15:44 last edited by
                                        #20

                                        Well, I reported this issue as bug on
                                        https://bugreports.qt.io/

                                        1 Reply Last reply
                                        0
                                        • S Offline
                                          S Offline
                                          sierdzio
                                          Moderators
                                          wrote on 29 May 2019, 18:27 last edited by
                                          #21

                                          Sounds like something that would not happen on Linux. I have never encountered this error, so I can only wish you luck :D

                                          (Z(:^

                                          1 Reply Last reply
                                          0

                                          11/30

                                          28 May 2019, 17:25

                                          • Login

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