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. Explanation configure options of QT for cross-compiling
QtWS25 Last Chance

Explanation configure options of QT for cross-compiling

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
8 Posts 3 Posters 1.6k 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.
  • A Offline
    A Offline
    ab-90
    wrote on 15 Apr 2020, 06:21 last edited by
    #1

    Hi All,

    that's my first topic here on the forum. I am trying to cross-compiling QT libraries 5.12.5 for my Raspberry PI 3B+ and then trying to cross-compiling a simply QT application.

    First of all I configured, built and installed from sources the libraries specifying the following data:
    ./configure -release -opengl es2 -device linux-rasp-pi3-g++ -device-option CROSS_COMPILE=<path_to_compiler> -sysroot <path_to_sysroot> -opensource -confirm-license -skip qtwayland -skip qtlocation -skip qtscript -make libs -prefix /usr/local/qt5pi -extprefix /develop/raspberry/qt5pi -hostprefix /develop/raspberry/qt5pi -no-use-gold-linker -no-gbm

    Sysroot has been downloaded from Raspi with rsync command.
    From the output of the whole process I can see the bin libraries has been installed in /develop/raspberry/qt5pi as stated in -extprefix and -hostprefix.
    Now I was wondering what is the role of -prefix path? If I am building everything on the host is that path important?
    And, as soon as I will deploy my application to final platform, Do I have to copy the whole /develop/raspberry/qt5pi into /usr/local/qt5pi?

    Thanks in advance,

    Andrea

    P 1 Reply Last reply 15 Apr 2020, 19:16
    0
    • A ab-90
      15 Apr 2020, 06:21

      Hi All,

      that's my first topic here on the forum. I am trying to cross-compiling QT libraries 5.12.5 for my Raspberry PI 3B+ and then trying to cross-compiling a simply QT application.

      First of all I configured, built and installed from sources the libraries specifying the following data:
      ./configure -release -opengl es2 -device linux-rasp-pi3-g++ -device-option CROSS_COMPILE=<path_to_compiler> -sysroot <path_to_sysroot> -opensource -confirm-license -skip qtwayland -skip qtlocation -skip qtscript -make libs -prefix /usr/local/qt5pi -extprefix /develop/raspberry/qt5pi -hostprefix /develop/raspberry/qt5pi -no-use-gold-linker -no-gbm

      Sysroot has been downloaded from Raspi with rsync command.
      From the output of the whole process I can see the bin libraries has been installed in /develop/raspberry/qt5pi as stated in -extprefix and -hostprefix.
      Now I was wondering what is the role of -prefix path? If I am building everything on the host is that path important?
      And, as soon as I will deploy my application to final platform, Do I have to copy the whole /develop/raspberry/qt5pi into /usr/local/qt5pi?

      Thanks in advance,

      Andrea

      P Offline
      P Offline
      Pablo J. Rogina
      wrote on 15 Apr 2020, 19:16 last edited by
      #2

      @ab-90 said in Explanation configure options of QT for cross-compiling:

      Do I have to copy the whole /develop/raspberry/qt5pi into /usr/local/qt5pi?

      I think so, preferably with rsync (so it's easy to update later) like this guide and this tutorial are suggesting.

      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
      1
      • A Offline
        A Offline
        ab-90
        wrote on 18 Apr 2020, 15:16 last edited by
        #3

        Hi,
        thanks for you reply.
        Just to be more clear: I am trying to cross-compile with Cmake a simply QT project on a Ubuntu virtual machine. For that reason, I want to build everything on the host machine.
        So the question is, is -prefix option important while working on host machine only? I have some problems with linker and I am asking myself if the library has been configured correcly.

        AB

        R 1 Reply Last reply 18 Apr 2020, 15:43
        0
        • A ab-90
          18 Apr 2020, 15:16

          Hi,
          thanks for you reply.
          Just to be more clear: I am trying to cross-compile with Cmake a simply QT project on a Ubuntu virtual machine. For that reason, I want to build everything on the host machine.
          So the question is, is -prefix option important while working on host machine only? I have some problems with linker and I am asking myself if the library has been configured correcly.

          AB

          R Offline
          R Offline
          raven-worx
          Moderators
          wrote on 18 Apr 2020, 15:43 last edited by
          #4

          @ab-90

          Now I was wondering what is the role of -prefix path?

          on linux this prefix is compiled into the binaries and read from the compiler linker during compilation and from system linker during loading.

          And, as soon as I will deploy my application to final platform, Do I have to copy the whole /develop/raspberry/qt5pi into /usr/local/qt5pi?

          after compiling Qt simply call make install and copy everything from the specified prefix

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

          A 1 Reply Last reply 18 Apr 2020, 15:57
          1
          • R raven-worx
            18 Apr 2020, 15:43

            @ab-90

            Now I was wondering what is the role of -prefix path?

            on linux this prefix is compiled into the binaries and read from the compiler linker during compilation and from system linker during loading.

            And, as soon as I will deploy my application to final platform, Do I have to copy the whole /develop/raspberry/qt5pi into /usr/local/qt5pi?

            after compiling Qt simply call make install and copy everything from the specified prefix

            A Offline
            A Offline
            ab-90
            wrote on 18 Apr 2020, 15:57 last edited by
            #5

            @raven-worx
            I think it's not clear to me the last step. After I did ./configure <my-options>, make and make install I get the output of the build procedure in estprefix path on my PC (with tools since the path is the same).
            At the moment, I don't want to copy that on my raspberry since I just want to build on my PC a program. But, as soon as, I configure my CMake I got a linker error which is looking to /lib/arm-linux-gnueabihf/ld-linux-armhf.so.3 path.
            In my opinion this error is due to the fact QT libraries have to be linked against this system library but the linker should look into sysroot path.
            Am I missing something?

            AB

            P 1 Reply Last reply 18 Apr 2020, 23:04
            0
            • A ab-90
              18 Apr 2020, 15:57

              @raven-worx
              I think it's not clear to me the last step. After I did ./configure <my-options>, make and make install I get the output of the build procedure in estprefix path on my PC (with tools since the path is the same).
              At the moment, I don't want to copy that on my raspberry since I just want to build on my PC a program. But, as soon as, I configure my CMake I got a linker error which is looking to /lib/arm-linux-gnueabihf/ld-linux-armhf.so.3 path.
              In my opinion this error is due to the fact QT libraries have to be linked against this system library but the linker should look into sysroot path.
              Am I missing something?

              AB

              P Offline
              P Offline
              Pablo J. Rogina
              wrote on 18 Apr 2020, 23:04 last edited by
              #6

              @ab-90 said in Explanation configure options of QT for cross-compiling:

              I don't want to copy that on my raspberry since I just want to build on my PC a program.

              So why did you cross-compile Qt to start? :-)

              You can build your Qt app for your PC given that you use a proper defined kit for such platform

              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
              • A Offline
                A Offline
                ab-90
                wrote on 19 Apr 2020, 08:35 last edited by
                #7

                @Pablo-J-Rogina sorry, maybe my previous response was not so clear. As soon as I get QT libraries built for raspi, my goal is to cross-compile a whole QT application on my PC for raspi too. In order to do that I rely on a CMake file where I set CMAKE_TOOLCHAIN_FILE variable in order to set C/CXX compiler and Sysroot path.
                I know that I will have to move to target the built libraries in order to run an app there.

                Before that, the problem rises when I build with that configuration on host PC since I got the following errors:

                • /develop/raspberry/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld: cannot find /lib/arm-linux-gnueabihf/libc.so.6
                • /develop/raspberry/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld: cannot find /usr/lib/arm-linux-gnueabihf/libc_nonshared.a
                • /develop/raspberry/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld: cannot find /lib/arm-linux-gnueabihf/ld-linux-armhf.so.3

                So it seems the build procedure is looking for that files inside the root of my host PC e not on my sysroot. I suppose there is some error in configuration of QT libraries since with a simple hello world C++ program everything work.

                Thanks

                AB

                P 1 Reply Last reply 19 Apr 2020, 18:41
                0
                • A ab-90
                  19 Apr 2020, 08:35

                  @Pablo-J-Rogina sorry, maybe my previous response was not so clear. As soon as I get QT libraries built for raspi, my goal is to cross-compile a whole QT application on my PC for raspi too. In order to do that I rely on a CMake file where I set CMAKE_TOOLCHAIN_FILE variable in order to set C/CXX compiler and Sysroot path.
                  I know that I will have to move to target the built libraries in order to run an app there.

                  Before that, the problem rises when I build with that configuration on host PC since I got the following errors:

                  • /develop/raspberry/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld: cannot find /lib/arm-linux-gnueabihf/libc.so.6
                  • /develop/raspberry/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld: cannot find /usr/lib/arm-linux-gnueabihf/libc_nonshared.a
                  • /develop/raspberry/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld: cannot find /lib/arm-linux-gnueabihf/ld-linux-armhf.so.3

                  So it seems the build procedure is looking for that files inside the root of my host PC e not on my sysroot. I suppose there is some error in configuration of QT libraries since with a simple hello world C++ program everything work.

                  Thanks

                  AB

                  P Offline
                  P Offline
                  Pablo J. Rogina
                  wrote on 19 Apr 2020, 18:41 last edited by
                  #8

                  @ab-90 said in Explanation configure options of QT for cross-compiling:

                  CMake file where I set CMAKE_TOOLCHAIN_FILE variable in order to set C/CXX compiler and Sysroot path.

                  I'm not well versed on CMake, but usually the path for the compiler and the sysroot folder are two different locations

                  the build procedure is looking for that files inside the root of my host PC e not on my sysroot

                  yes, it looks like so it seems you need to modify your CMake file(s) to reflect your environment

                  there is some error in configuration of QT libraries

                  I'd say problem with your build procedure, not the Qt libraries

                  since with a simple hello world C++ program everything work.

                  Do you mean a simple cross-compiled Qt app running Ok on the target device?

                  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

                  3/8

                  18 Apr 2020, 15:16

                  topic:navigator.unread, 5
                  • Login

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