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. Getting started QT cross-compile to Rpi4
Forum Updated to NodeBB v4.3 + New Features

Getting started QT cross-compile to Rpi4

Scheduled Pinned Locked Moved Unsolved QtonPi
16 Posts 4 Posters 4.0k 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.
  • MichRX7M MichRX7

    @koahnig said in Getting started QT cross-compile to Rpi4:

    @MichRX7

    How do you run sftp from creator?
    Are you sure that the same environment is used from creator?

    In Creator, following a blog I found (and an old video on the qt site) I went to tools->options->devices. Here I choose Add and tell it Generic Linux Device. Fill in the form with IP of the PI and username, apply and hit test. It attempts a test to connect to the Pi. It connects, but fails out on the sftp and rsync, so I'm guessing it won't sync files over to the Pi. The output I pasted above is what I get when I hit test.

    @koahnig said in Getting started QT cross-compile to Rpi4:

    @MichRX7

    How do you run sftp from creator?
    Are you sure that the same environment is used from creator?

    The output I posted above is the test I run after trying to setup the device in tools->options->devices. It does connect to the Pi during the test if you read the output, but it fails when it tries to use sftp or rsync which I am guessing it uses to transfer the build over to the Rpi to see your program in action.

    In windows on the computer that is running QT Creator I am able to open a command prompt and connect to the PI via ssh and sftp, so I don't understand why QT Creator would fail attempting the same. The only thing I can guess is I haven't updated the version of QT that came on the PI Raspbian build. I tried reading some blogs on updating that, but they are very confusing.

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

    @MichRX7

    Sorry, I have no experience in that part.

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

    1 Reply Last reply
    0
    • MichRX7M Offline
      MichRX7M Offline
      MichRX7
      wrote on last edited by
      #7

      Ok, so I took a desktop that I had laying around and installed Debian Linux on it. I have now installed QT Creator on that laptop. I tried to follow the directions here to be able to cross-compile on the pi, but everything breaks down right about the time I'm supposed to configure (step 10).

      I also tried to use this blog along with the wiki, and again, I get lost right around the configure command.

      Does anyone have a "Install this in 5 easy steps for cross-compiling between Linux and Pi" blog I could follow? I can't imagine it is this hard to write gui software for a Rpi.

      jsulmJ 1 Reply Last reply
      0
      • MichRX7M MichRX7

        Ok, so I took a desktop that I had laying around and installed Debian Linux on it. I have now installed QT Creator on that laptop. I tried to follow the directions here to be able to cross-compile on the pi, but everything breaks down right about the time I'm supposed to configure (step 10).

        I also tried to use this blog along with the wiki, and again, I get lost right around the configure command.

        Does anyone have a "Install this in 5 easy steps for cross-compiling between Linux and Pi" blog I could follow? I can't imagine it is this hard to write gui software for a Rpi.

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #8

        @MichRX7 said in Getting started QT cross-compile to Rpi4:

        I can't imagine it is this hard to write gui software for a Rpi.

        Cross compilation is not an easy task in general.
        Writing GUI apps directly on RPi is as easy as on PC.

        If you have problems with cross compilation you should say what you did and what was the problem.

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

        MichRX7M 1 Reply Last reply
        1
        • jsulmJ jsulm

          @MichRX7 said in Getting started QT cross-compile to Rpi4:

          I can't imagine it is this hard to write gui software for a Rpi.

          Cross compilation is not an easy task in general.
          Writing GUI apps directly on RPi is as easy as on PC.

          If you have problems with cross compilation you should say what you did and what was the problem.

          MichRX7M Offline
          MichRX7M Offline
          MichRX7
          wrote on last edited by
          #9

          @jsulm Well, I guess the question is should I just jump on the Pi, open a browser and install QT/Creator on the Pi? I'm more than happy to do that, lol...

          But, what I did this time around is I took an unsed PC I had lying around and installed Debian on it, then I opened a browser and installed QT 5.14.1, then I tried to follow the wiki and the blog I reference above, but utilizing the newest version of QT instead of their older version in the posts. Everything seemed to be going well until I hit the compile/make sections of both posts and I start receiving errors.

          Here is what I'm entering for the configure:
          ./configure -release -opengl es2 -device <rpi-version> -device-option CROSS_COMPILE=~/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf- -sysroot ~/raspi/sysroot -opensource -confirm-license -make libs -prefix /usr/local/qt5pi -extprefix ~/raspi/qt5pi -hostprefix ~/raspi/qt5 -v

          Here is what is returned
          bash: rpi-version: No such file or directory

          I also tried:
          ./configure -release -opengl es2 -device linux-rasp-pi4-v3d-g++ -device-option CROSS_COMPILE=/opt/raspberry/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- -sysroot /opt/raspberry/sysroot -opensource -confirm-license -make libs -prefix /usr/local/qt5pi -extprefix /opt/raspberry/qt5pi -hostprefix /opt/raspberry/qt5pi_host -v

          Here is the output from that:

          • cd qtbase
          • /root/raspi/qt-everywhere-src-5.14.1/qtbase/configure -top-level -release -opengl es2 -device linux-rasp-pi4-v3d-g++ -device-option CROSS_COMPILE=/opt/raspberry/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- -sysroot /opt/raspberry/sysroot -opensource -confirm-license -make libs -prefix /usr/local/qt5pi -extprefix /opt/raspberry/qt5pi -hostprefix /opt/raspberry/qt5pi_host -v
            Creating qmake...
            make: Nothing to be done for 'first'.
            Command line: -release -opengl es2 -device linux-rasp-pi4-v3d-g++ -device-option CROSS_COMPILE=/opt/raspberry/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- -sysroot /opt/raspberry/sysroot -opensource -confirm-license -make libs -prefix /usr/local/qt5pi -extprefix /opt/raspberry/qt5pi -hostprefix /opt/raspberry/qt5pi_host -v
            Project ERROR: Cannot run target compiler '/opt/raspberry/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++'. Output:
            ===================
            sh: 1: /opt/raspberry/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++: not found
            ===================
            Maybe you forgot to setup the environment?

          So, now I try and figure out where to go from there...

          K 1 Reply Last reply
          0
          • MichRX7M MichRX7

            @jsulm Well, I guess the question is should I just jump on the Pi, open a browser and install QT/Creator on the Pi? I'm more than happy to do that, lol...

            But, what I did this time around is I took an unsed PC I had lying around and installed Debian on it, then I opened a browser and installed QT 5.14.1, then I tried to follow the wiki and the blog I reference above, but utilizing the newest version of QT instead of their older version in the posts. Everything seemed to be going well until I hit the compile/make sections of both posts and I start receiving errors.

            Here is what I'm entering for the configure:
            ./configure -release -opengl es2 -device <rpi-version> -device-option CROSS_COMPILE=~/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf- -sysroot ~/raspi/sysroot -opensource -confirm-license -make libs -prefix /usr/local/qt5pi -extprefix ~/raspi/qt5pi -hostprefix ~/raspi/qt5 -v

            Here is what is returned
            bash: rpi-version: No such file or directory

            I also tried:
            ./configure -release -opengl es2 -device linux-rasp-pi4-v3d-g++ -device-option CROSS_COMPILE=/opt/raspberry/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- -sysroot /opt/raspberry/sysroot -opensource -confirm-license -make libs -prefix /usr/local/qt5pi -extprefix /opt/raspberry/qt5pi -hostprefix /opt/raspberry/qt5pi_host -v

            Here is the output from that:

            • cd qtbase
            • /root/raspi/qt-everywhere-src-5.14.1/qtbase/configure -top-level -release -opengl es2 -device linux-rasp-pi4-v3d-g++ -device-option CROSS_COMPILE=/opt/raspberry/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- -sysroot /opt/raspberry/sysroot -opensource -confirm-license -make libs -prefix /usr/local/qt5pi -extprefix /opt/raspberry/qt5pi -hostprefix /opt/raspberry/qt5pi_host -v
              Creating qmake...
              make: Nothing to be done for 'first'.
              Command line: -release -opengl es2 -device linux-rasp-pi4-v3d-g++ -device-option CROSS_COMPILE=/opt/raspberry/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- -sysroot /opt/raspberry/sysroot -opensource -confirm-license -make libs -prefix /usr/local/qt5pi -extprefix /opt/raspberry/qt5pi -hostprefix /opt/raspberry/qt5pi_host -v
              Project ERROR: Cannot run target compiler '/opt/raspberry/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++'. Output:
              ===================
              sh: 1: /opt/raspberry/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++: not found
              ===================
              Maybe you forgot to setup the environment?

            So, now I try and figure out where to go from there...

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

            @MichRX7

            Possibly a stupid question but did you install the cross-compiler and is it available in the specified location?

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

            MichRX7M 1 Reply Last reply
            0
            • K koahnig

              @MichRX7

              Possibly a stupid question but did you install the cross-compiler and is it available in the specified location?

              MichRX7M Offline
              MichRX7M Offline
              MichRX7
              wrote on last edited by
              #11

              @koahnig said in Getting started QT cross-compile to Rpi4:

              @MichRX7

              Possibly a stupid question but did you install the cross-compiler and is it available in the specified location?

              No question is stupid, because I am a Linux/qt newbie.

              So, if I look on the Linux pc (not the Pi) I do not see anything in /opt/ (aka, no raspberry directory) which I guess answers that. Did I miss a step on installing this?

              K 1 Reply Last reply
              0
              • MichRX7M MichRX7

                @koahnig said in Getting started QT cross-compile to Rpi4:

                @MichRX7

                Possibly a stupid question but did you install the cross-compiler and is it available in the specified location?

                No question is stupid, because I am a Linux/qt newbie.

                So, if I look on the Linux pc (not the Pi) I do not see anything in /opt/ (aka, no raspberry directory) which I guess answers that. Did I miss a step on installing this?

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

                @MichRX7

                Regardless where you compile you need to install a proper compiler for the RPi.

                Therefore, either compiling on Windows or Linux you need a cross-compiler for cross-compiling. If you would compile of RPi directly, you need to have there a proper compiler too. However, you wouldnot call it cross-compiler then.

                Typically the guidelines found shall give you some hint on where to find a suitable cross-compiler for your task. Check the RPi user fora for that.

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

                MichRX7M 1 Reply Last reply
                0
                • K koahnig

                  @MichRX7

                  Regardless where you compile you need to install a proper compiler for the RPi.

                  Therefore, either compiling on Windows or Linux you need a cross-compiler for cross-compiling. If you would compile of RPi directly, you need to have there a proper compiler too. However, you wouldnot call it cross-compiler then.

                  Typically the guidelines found shall give you some hint on where to find a suitable cross-compiler for your task. Check the RPi user fora for that.

                  MichRX7M Offline
                  MichRX7M Offline
                  MichRX7
                  wrote on last edited by
                  #13

                  @koahnig Thanks for the reply. Would those links I shared be the correct one's? I thought it would build the directories and files for the Pi and the Cross-Compile machine. Obviously I did something wrong, but if I knew they were what I was looking for I'd try again (and again, and again, lol...)

                  K 1 Reply Last reply
                  0
                  • MichRX7M MichRX7

                    @koahnig Thanks for the reply. Would those links I shared be the correct one's? I thought it would build the directories and files for the Pi and the Cross-Compile machine. Obviously I did something wrong, but if I knew they were what I was looking for I'd try again (and again, and again, lol...)

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

                    @MichRX7

                    This link looks fine to me. https://www.ics.com/blog/configuring-qt-creator-raspberry-pi
                    No guarantee since I simply checked what is there. If you have follwed this already partly. You have missed to setup the cross-compiler of step 3.
                    For step 4 I would go for a newer version of Qt. Version 5.7 is a bit dusty already. Maybe checkout Qt5.14.1 or one of Qt5.12.x versions.

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

                    1 Reply Last reply
                    0
                    • J Offline
                      J Offline
                      JackTr
                      wrote on last edited by
                      #15

                      Did you(or anyone else) got it running by now? And if yes, how?
                      I also always get stuck at step 10 no matter what guide I used (about 9 different ones)
                      and I would consider myself as not new at linux or/and qt creator.
                      I got Android cross compiling up and
                      running but raspberry seems to be a struggle/chellange by itself.

                      K 1 Reply Last reply
                      0
                      • J JackTr

                        Did you(or anyone else) got it running by now? And if yes, how?
                        I also always get stuck at step 10 no matter what guide I used (about 9 different ones)
                        and I would consider myself as not new at linux or/and qt creator.
                        I got Android cross compiling up and
                        running but raspberry seems to be a struggle/chellange by itself.

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

                        @JackTr

                        You need to give more specific information on your actual issue with cross-compiling.

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

                        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