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. Problem using QT5 configure for cross-compiling from Ubuntu to Raspberry pi3
Forum Update on Tuesday, May 27th 2025

Problem using QT5 configure for cross-compiling from Ubuntu to Raspberry pi3

Scheduled Pinned Locked Moved Solved Installation and Deployment
14 Posts 4 Posters 3.4k Views 2 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.
  • J Offline
    J Offline
    Jon_J
    wrote on 7 Jun 2018, 21:12 last edited by
    #1

    I have a QT application that I am able to build and run with QT5 which was not built by me. I want to change some things with QT5 so I have set up my environment to build QT5 locally having followed several web pages on how to do so. The problem is that I don't get any farther than the configure step (see below). It doesn't matter if I just execute: "./configure -v" or a more specific command line. Either way, I get the same result. The indicated file is located in the ".../src/corelib/global" directory. Why am I getting this error during configuration?

    $ ./configure -v
    Creating qmake...
    g++ -c -o main.o -std=c++11 -ffunction-sections -g -g -I/home/jon/raspi/qtbase-5.10.1/qmake -I/home/jon/raspi/qtbase-5.10.1/qmake/library -I/home/jon/raspi/qtbase-5.10.1/qmake/generators -I/home/jon/raspi/qtbase-5.10.1/qmake/generators/unix -I/home/jon/raspi/qtbase-5.10.1/qmake/generators/win32 -I/home/jon/raspi/qtbase-5.10.1/qmake/generators/mac -I/home/jon/raspi/qtbase-5.10.1/include -I/home/jon/raspi/qtbase-5.10.1/include/QtCore -I/home/jon/raspi/qtbase-5.10.1/include/QtCore/5.10.1 -I/home/jon/raspi/qtbase-5.10.1/include/QtCore/5.10.1/QtCore -I../src/corelib/global -I/home/jon/raspi/qtbase-5.10.1/mkspecs/linux-g++ -DQT_VERSION_STR="5.10.1" -DQT_VERSION_MAJOR=5 -DQT_VERSION_MINOR=10 -DQT_VERSION_PATCH=1 -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DPROEVALUATOR_FULL -DQT_NO_FOREACH /home/jon/raspi/qtbase-5.10.1/qmake/main.cpp
    In file included from /home/jon/raspi/qtbase-5.10.1/qmake/library/qmake_global.h:32:0,
    from /home/jon/raspi/qtbase-5.10.1/qmake/library/qmakeparser.h:32,
    from /home/jon/raspi/qtbase-5.10.1/qmake/library/qmakeevaluator.h:36,
    from /home/jon/raspi/qtbase-5.10.1/qmake/project.h:32,
    from /home/jon/raspi/qtbase-5.10.1/qmake/main.cpp:30:
    ../src/corelib/global/qglobal.h:63:10: fatal error: QtCore/qconfig-bootstrapped.h: No such file or directory
    #include <QtCore/qconfig-bootstrapped.h>
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 7 Jun 2018, 21:43 last edited by
      #2

      Hi,

      Are you doing it that from a clean state ?

      I'd recommend using out of source build. That way, if something goes wrong, you can simply nuke the folder and you also keep your sources clean.

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

      J 1 Reply Last reply 7 Jun 2018, 22:06
      0
      • S SGaist
        7 Jun 2018, 21:43

        Hi,

        Are you doing it that from a clean state ?

        I'd recommend using out of source build. That way, if something goes wrong, you can simply nuke the folder and you also keep your sources clean.

        J Offline
        J Offline
        Jon_J
        wrote on 7 Jun 2018, 22:06 last edited by
        #3

        @SGaist I'm not sure in this case what constitutes a clean state. How do I make sure that I have a clean state? How do I do an out of source build? I like the idea of being able to recover by simply deleting a folder.

        J 1 Reply Last reply 8 Jun 2018, 07:23
        0
        • J Jon_J
          7 Jun 2018, 22:06

          @SGaist I'm not sure in this case what constitutes a clean state. How do I make sure that I have a clean state? How do I do an out of source build? I like the idea of being able to recover by simply deleting a folder.

          J Offline
          J Offline
          jsulm
          Lifetime Qt Champion
          wrote on 8 Jun 2018, 07:23 last edited by
          #4

          @Jon_J Clean state means: no build artefacts from previous builds inside the source tree.

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

          J 1 Reply Last reply 8 Jun 2018, 13:48
          0
          • J jsulm
            8 Jun 2018, 07:23

            @Jon_J Clean state means: no build artefacts from previous builds inside the source tree.

            J Offline
            J Offline
            Jon_J
            wrote on 8 Jun 2018, 13:48 last edited by
            #5

            @jsulm I have a clean state then as nothing has been built. There are no ".o", ".a", or ".so" files in the source tree. No builds have been possible as 'configure' fails compilation on the first module that it attempts to build.

            P 1 Reply Last reply 8 Jun 2018, 16:07
            0
            • J Jon_J
              8 Jun 2018, 13:48

              @jsulm I have a clean state then as nothing has been built. There are no ".o", ".a", or ".so" files in the source tree. No builds have been possible as 'configure' fails compilation on the first module that it attempts to build.

              P Offline
              P Offline
              Pablo J. Rogina
              wrote on 8 Jun 2018, 16:07 last edited by
              #6

              @Jon_J

              cross-compiling from Ubuntu to Raspberry pi3

              Could you describe your environment?
              Have you install a cross compiler?
              What about sysroot?

              I'd suggest following this guide.

              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

              J 1 Reply Last reply 8 Jun 2018, 18:59
              0
              • P Pablo J. Rogina
                8 Jun 2018, 16:07

                @Jon_J

                cross-compiling from Ubuntu to Raspberry pi3

                Could you describe your environment?
                Have you install a cross compiler?
                What about sysroot?

                I'd suggest following this guide.

                J Offline
                J Offline
                Jon_J
                wrote on 8 Jun 2018, 18:59 last edited by
                #7

                @Pablo-J.-Rogina I have an environment that allows me to currently build and run a Qt Creator application on a Raspberry pi3. That includes having already previously followed most of the steps from the guide that you suggest. The difference is that instead of using a previously build Qt base, I am trying to build a Qt base locally. Please note that the failure that I am experiencing occurs when I run the 'configure' utility and has nothing to do with my having previously installed the correct cross compiler or creating a sysroot. These both work just fine when I build the application with the Qt base that was previously built. I believe that the problem that I am trying to solve involves specifying an include path somehow to 'configure' so that it can find the 'missing' includes. Passing an additional '-I ....' string has no effect when qmake is attempting to build.

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 8 Jun 2018, 19:40 last edited by SGaist 6 Aug 2018, 20:19
                  #8

                  One thing that is strange, you say you are cross-compiling except that you are calling configure without any parameter related to cross-compiling.

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

                  J 1 Reply Last reply 8 Jun 2018, 20:19
                  0
                  • S SGaist
                    8 Jun 2018, 19:40

                    One thing that is strange, you say you are cross-compiling except that you are calling configure without any parameter related to cross-compiling.

                    J Offline
                    J Offline
                    Jon_J
                    wrote on 8 Jun 2018, 20:19 last edited by
                    #9

                    @SGaist I am successfully cross-compiling with a previously built Qt base. Here is the same result when 'configure' is given a lot more valid arguments:

                    $ ./configure -release -opengl es2 -device linux-rasp-pi-g++ -device-option CROSS_COMPILE=arm-linux-gnueabihf-g++ -sysroot /usr/local/raspi/sysroot -opensource -confirm-license -make libs -prefix /usr/local/qt5pi -v
                    Creating qmake...
                    g++ -c -o main.o -std=c++11 -ffunction-sections -g -g -I/home/jon/raspi/qtbase-5.10.1/qmake -I/home/jon/raspi/qtbase-5.10.1/qmake/library -I/home/jon/raspi/qtbase-5.10.1/qmake/generators -I/home/jon/raspi/qtbase-5.10.1/qmake/generators/unix -I/home/jon/raspi/qtbase-5.10.1/qmake/generators/win32 -I/home/jon/raspi/qtbase-5.10.1/qmake/generators/mac -I/home/jon/raspi/qtbase-5.10.1/include -I/home/jon/raspi/qtbase-5.10.1/include/QtCore -I/home/jon/raspi/qtbase-5.10.1/include/QtCore/5.10.1 -I/home/jon/raspi/qtbase-5.10.1/include/QtCore/5.10.1/QtCore -I../src/corelib/global -I/home/jon/raspi/qtbase-5.10.1/mkspecs/linux-g++ -DQT_VERSION_STR="5.10.1" -DQT_VERSION_MAJOR=5 -DQT_VERSION_MINOR=10 -DQT_VERSION_PATCH=1 -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DPROEVALUATOR_FULL -DQT_NO_FOREACH /home/jon/raspi/qtbase-5.10.1/qmake/main.cpp
                    In file included from /home/jon/raspi/qtbase-5.10.1/qmake/library/qmake_global.h:32:0,
                    from /home/jon/raspi/qtbase-5.10.1/qmake/library/qmakeparser.h:32,
                    from /home/jon/raspi/qtbase-5.10.1/qmake/library/qmakeevaluator.h:36,
                    from /home/jon/raspi/qtbase-5.10.1/qmake/project.h:32,
                    from /home/jon/raspi/qtbase-5.10.1/qmake/main.cpp:30:
                    ../src/corelib/global/qglobal.h:63:10: fatal error: QtCore/qconfig-bootstrapped.h: No such file or directory
                    #include <QtCore/qconfig-bootstrapped.h>
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

                    I am able to get to the next 'missing' include file if I manually change file: 'qglobal.h' to specify the full path of the 'missing' include file. As I understand it, cross-compiling my Raspberry Pi application is a subsequent step to building qmake, which is what 'configure' is attempting to do. Ideas?

                    1 Reply Last reply
                    0
                    • S Offline
                      S Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on 8 Jun 2018, 20:27 last edited by
                      #10

                      You need to have Qt cross-compiled first and then you'll be able to cross-compile your application.

                      Where did you get these sources from ?

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

                      J 1 Reply Last reply 8 Jun 2018, 20:49
                      0
                      • S SGaist
                        8 Jun 2018, 20:27

                        You need to have Qt cross-compiled first and then you'll be able to cross-compile your application.

                        Where did you get these sources from ?

                        J Offline
                        J Offline
                        Jon_J
                        wrote on 8 Jun 2018, 20:49 last edited by
                        #11

                        @SGaist Source for Qt base came from here: https://github.com/qt/qtbase/tree/5.10.1. It would seem that 'configure' wants to build 'qmake' first which it can't because it is unable to locate include files due to not having an include path defined. What am I missing?

                        1 Reply Last reply
                        0
                        • S Offline
                          S Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote on 8 Jun 2018, 21:01 last edited by
                          #12

                          Github is a mirror, you should rather use https://code.qt.io

                          It seems that the forward includes are not generated. Do you have all the dependencies to build Qt installed ?

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

                          J 1 Reply Last reply 8 Jun 2018, 21:45
                          1
                          • S SGaist
                            8 Jun 2018, 21:01

                            Github is a mirror, you should rather use https://code.qt.io

                            It seems that the forward includes are not generated. Do you have all the dependencies to build Qt installed ?

                            J Offline
                            J Offline
                            Jon_J
                            wrote on 8 Jun 2018, 21:45 last edited by
                            #13

                            @SGaist The problem was that I had an incomplete source tree. Got the code from the link that you recommended and it appears to be building now. Thanks!

                            1 Reply Last reply
                            0
                            • S Offline
                              S Offline
                              SGaist
                              Lifetime Qt Champion
                              wrote on 8 Jun 2018, 21:49 last edited by
                              #14

                              That's strange...

                              Anyway, glad you found out and thanks for sharing !

                              Since you have it building now, please mark the thread as solved using the "Topic Tools" button so that other forum users may know a solution has been found :)

                              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

                              10/14

                              8 Jun 2018, 20:27

                              • Login

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