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 Updated to NodeBB v4.3 + New Features

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.5k 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.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on 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
    0
    • SGaistS SGaist

      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 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.

      jsulmJ 1 Reply Last reply
      0
      • J Jon_J

        @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.

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on 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
        0
        • jsulmJ jsulm

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

          J Offline
          J Offline
          Jon_J
          wrote on 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.

          Pablo J. RoginaP 1 Reply Last reply
          0
          • J Jon_J

            @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.

            Pablo J. RoginaP Offline
            Pablo J. RoginaP Offline
            Pablo J. Rogina
            wrote on 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
            0
            • Pablo J. RoginaP Pablo J. Rogina

              @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 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
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by SGaist
                #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
                0
                • SGaistS SGaist

                  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 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
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on 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
                    0
                    • SGaistS SGaist

                      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 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
                      • SGaistS Offline
                        SGaistS Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on 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
                        1
                        • SGaistS SGaist

                          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 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
                          • SGaistS Offline
                            SGaistS Offline
                            SGaist
                            Lifetime Qt Champion
                            wrote on 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

                            • Login

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