Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Compiling a QT app for Raspberry Pi on MacOS/OSX
Forum Updated to NodeBB v4.3 + New Features

Compiling a QT app for Raspberry Pi on MacOS/OSX

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
12 Posts 5 Posters 4.9k 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.
  • C Offline
    C Offline
    Casp
    wrote on last edited by
    #1

    Hi,

    I'm new to Qt and trying to get one of the example Qt projects working on a Raspberry Pi to test the workflow and from what I can read, there's no way to cross-compile on OSX/MacOS for a Raspberry Pi Raspian target? Do I need to have a Linux machine to just be able to compile for the Raspberry Pi (within a reasonable timeframe)?

    It seems like quite the long route to do my design and development on one machine and then copy it over to another just to compile and then that has to be copied again (but at least the RaspberryPi2EGLFS guide should make that last stage faster) . I could do a bootcamp dual boot but overall having to go through so many steps in the round tripping slows precious development time.

    #1. Is there some way to achieve the effect in the RaspberryPi2EGLFS guide but with OSX instead of Linux on the host PC?

    jsulmJ 1 Reply Last reply
    0
    • C Casp

      Hi,

      I'm new to Qt and trying to get one of the example Qt projects working on a Raspberry Pi to test the workflow and from what I can read, there's no way to cross-compile on OSX/MacOS for a Raspberry Pi Raspian target? Do I need to have a Linux machine to just be able to compile for the Raspberry Pi (within a reasonable timeframe)?

      It seems like quite the long route to do my design and development on one machine and then copy it over to another just to compile and then that has to be copied again (but at least the RaspberryPi2EGLFS guide should make that last stage faster) . I could do a bootcamp dual boot but overall having to go through so many steps in the round tripping slows precious development time.

      #1. Is there some way to achieve the effect in the RaspberryPi2EGLFS guide but with OSX instead of Linux on the host PC?

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

      @Casp You could have a virtual machine with Linux.
      Regarding copying project: use a source code versioning system like Git or Subversion.

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

      1 Reply Last reply
      1
      • sierdzioS Offline
        sierdzioS Offline
        sierdzio
        Moderators
        wrote on last edited by
        #3

        I have no Mac to check, but I think followint the RaspberryPi2EGLFS guide should still be possible. Nothing particularly extraordinary is done there - as long as you have rsync available on Mac (dunno if that's the case), it should (might?) work.

        (Z(:^

        C 1 Reply Last reply
        0
        • sierdzioS sierdzio

          I have no Mac to check, but I think followint the RaspberryPi2EGLFS guide should still be possible. Nothing particularly extraordinary is done there - as long as you have rsync available on Mac (dunno if that's the case), it should (might?) work.

          C Offline
          C Offline
          Casp
          wrote on last edited by
          #4

          @sierdzio thanks for that suggestion! I have followed the RaspberryPi2EGLFS guide up to step #9 where I couldn’t get the python script to run (it said something like, as I’m not next to my Mac right now, “starting python command: directory not found”). I’ll have to spend some time understanding what is different in that script between OS X and Linux.

          Yet to just help. Q#2) Is the tool chain a standalone library that doesn’t depend on the operating system to work? I had some idea that it drew on components of the OS. I’ll just skip step 9 for now and see what I can get working.

          I’m keen to get it working on OSX if I can because I think that’s a bit of a missing link to getting another user base on Qt. If you get hobbyists using Raspberry Pi’s over to Qt that increases the employment base and decreases the development cost and thus increases use of the Qt and hopefully the quality of projects too.

          I’m still looking for a solid replacement for Flash for touchscreen development (JS and Chrome isn’t that nice still)

          sierdzioS 1 Reply Last reply
          0
          • C Casp

            @sierdzio thanks for that suggestion! I have followed the RaspberryPi2EGLFS guide up to step #9 where I couldn’t get the python script to run (it said something like, as I’m not next to my Mac right now, “starting python command: directory not found”). I’ll have to spend some time understanding what is different in that script between OS X and Linux.

            Yet to just help. Q#2) Is the tool chain a standalone library that doesn’t depend on the operating system to work? I had some idea that it drew on components of the OS. I’ll just skip step 9 for now and see what I can get working.

            I’m keen to get it working on OSX if I can because I think that’s a bit of a missing link to getting another user base on Qt. If you get hobbyists using Raspberry Pi’s over to Qt that increases the employment base and decreases the development cost and thus increases use of the Qt and hopefully the quality of projects too.

            I’m still looking for a solid replacement for Flash for touchscreen development (JS and Chrome isn’t that nice still)

            sierdzioS Offline
            sierdzioS Offline
            sierdzio
            Moderators
            wrote on last edited by
            #5

            @Casp said in Compiling a QT app for Raspberry Pi on MacOS/OSX:

            @sierdzio thanks for that suggestion! I have followed the RaspberryPi2EGLFS guide up to step #9 where I couldn’t get the python script to run (it said something like, as I’m not next to my Mac right now, “starting python command: directory not found”). I’ll have to spend some time understanding what is different in that script between OS X and Linux.

            I'm not a python pro, but the script does not look like it's doing any Linux-specific magic inside. It's only changing symlinks to relative ones. Are you sure you have python installed?

            Yet to just help. Q#2) Is the tool chain a standalone library that doesn’t depend on the operating system to work? I had some idea that it drew on components of the OS. I’ll just skip step 9 for now and see what I can get working.

            As far as I know the toolchain is standalone, indeed. It contains all the build tools (compiler, linker etc.).

            The sysroot is standalone as well - it is a copy of the crucial parts of Raspbian operating system.

            If you skip step 9, Qt compilation is very likely to fail - and the errors will be very misleading.

            I’m keen to get it working on OSX if I can because I think that’s a bit of a missing link to getting another user base on Qt. If you get hobbyists using Raspberry Pi’s over to Qt that increases the employment base and decreases the development cost and thus increases use of the Qt and hopefully the quality of projects too.

            Well, installing a VM with Linux is not a big hassle. For popular distros it takes around 15 minutes to have the OS up and running. But you're right, if RPi could be set up from Mac it would be a plus.

            I’m still looking for a solid replacement for Flash for touchscreen development (JS and Chrome isn’t that nice still)

            Qt is great on touch screens :-)

            (Z(:^

            1 Reply Last reply
            0
            • C Offline
              C Offline
              Casp
              wrote on last edited by
              #6

              Hi,

              Thanks for the response. I realised that I didn't have Python3 but an older version installed and once that was that script ran fine. So onto the next step #10 in RaspberryPi2EGLFS.

              I got the following error when I run the ./configure line in the instructions. I've read up and have g++ installed and that library is there and I'm running a 64 bit system so I put the x64 version of the compiler. Not sure what I'm looking for to resolve this one, so would love any suggestions:

              Project ERROR: Cannot run target compiler '/Users/username/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++'. Output:
              ===================
              sh: /Users/username/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++: cannot execute binary file
              ===================
              Maybe you forgot to setup the environment?
              
              1 Reply Last reply
              0
              • sierdzioS Offline
                sierdzioS Offline
                sierdzio
                Moderators
                wrote on last edited by
                #7

                Ugh, that's nasty but makes sense. It's a Linux binary so probably mac won't run it :(

                (Z(:^

                jsulmJ 1 Reply Last reply
                0
                • sierdzioS sierdzio

                  Ugh, that's nasty but makes sense. It's a Linux binary so probably mac won't run it :(

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

                  @sierdzio @Casp That's why I suggested to use a virtual machine with Linux :-)

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

                  sierdzioS 1 Reply Last reply
                  0
                  • jsulmJ jsulm

                    @sierdzio @Casp That's why I suggested to use a virtual machine with Linux :-)

                    sierdzioS Offline
                    sierdzioS Offline
                    sierdzio
                    Moderators
                    wrote on last edited by
                    #9

                    @jsulm said in Compiling a QT app for Raspberry Pi on MacOS/OSX:

                    @sierdzio @Casp That's why I suggested to use a virtual machine with Linux :-)

                    Yeah, sure. It was still interesting to take a shot at running it natively. Now we know :-)

                    (Z(:^

                    1 Reply Last reply
                    0
                    • J.HilkJ Online
                      J.HilkJ Online
                      J.Hilk
                      Moderators
                      wrote on last edited by J.Hilk
                      #10

                      Actually i have this blog-post here:

                      https://www.jaredwolff.com/blog/cross-compiling-on-mac-osx-for-raspberry-pi/

                      That I plan to follow sometime soon(TM) but haven't found the time yet to do so.
                      Maybe its of help for the OP.

                      Its not Qt-Specific but it sets up a cross-compile toolchain for MacOS-/-RasPi


                      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                      Q: What's that?
                      A: It's blue light.
                      Q: What does it do?
                      A: It turns blue.

                      1 Reply Last reply
                      2
                      • C Offline
                        C Offline
                        Casp
                        wrote on last edited by
                        #11

                        Thanks @J-Hilk I'll have a review of it. For now I've just decided to follow the standard Linux route under VirtualBox

                        1 Reply Last reply
                        0
                        • R Offline
                          R Offline
                          raulicomr
                          wrote on last edited by
                          #12

                          Hi, please take a look to this how-to: https://github.com/raulicomr/qt-rpi-macos

                          It could be helpful for you.

                          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