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. Setup Qt on windows 7 to cross compile for Raspberry Pi 2

Setup Qt on windows 7 to cross compile for Raspberry Pi 2

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
18 Posts 4 Posters 7.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.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #7

    That ok, but what's not clear is whether you want to build a Qt application to run on your Pi.

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

    avgjoecoderA 1 Reply Last reply
    0
    • SGaistS SGaist

      That ok, but what's not clear is whether you want to build a Qt application to run on your Pi.

      avgjoecoderA Offline
      avgjoecoderA Offline
      avgjoecoder
      wrote on last edited by
      #8

      @SGaist

      I want to write a C++ app USING qt and run it on the pi.

      avgjoecoderA 1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #9

        In that case, you must first cross-compile Qt in order to build your application for the Pi.

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

        avgjoecoderA 1 Reply Last reply
        0
        • avgjoecoderA avgjoecoder

          @SGaist

          I want to write a C++ app USING qt and run it on the pi.

          avgjoecoderA Offline
          avgjoecoderA Offline
          avgjoecoder
          wrote on last edited by
          #10

          @avgjoecoder

          Or specifically write a C++ app using "QT Creator". QT Creator is already running on my win7 pc. The target for the C++ app is the pi.

          1 Reply Last reply
          0
          • SGaistS SGaist

            In that case, you must first cross-compile Qt in order to build your application for the Pi.

            avgjoecoderA Offline
            avgjoecoderA Offline
            avgjoecoder
            wrote on last edited by
            #11

            @SGaist

            Why do I need to compile qt? I only want to run my c++ app on the pi, not QT. Why do I need qt on the pi at all?? I was under the impression that once you cross compile your c++ into a binary, you could simply copy it to the pi and run it. Shouldn't all of the dependencies be compiled into the binary? Perhaps that is a bad assumption?

            jsulmJ 2 Replies Last reply
            0
            • avgjoecoderA avgjoecoder

              @SGaist

              Why do I need to compile qt? I only want to run my c++ app on the pi, not QT. Why do I need qt on the pi at all?? I was under the impression that once you cross compile your c++ into a binary, you could simply copy it to the pi and run it. Shouldn't all of the dependencies be compiled into the binary? Perhaps that is a bad assumption?

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

              @avgjoecoder You should use the correct wording to avoid misunderstandings!
              "I want to write a C++ app USING qt and run it on the pi." - that means you want to use Qt for your application which will run on RPI. What you really mean is: "I want to use QtCreator to develop for RPI". Qt is not the same as QtCreator. If you only want to use QtCreator for developing and don't want to use Qt for your application then you do not have to compile Qt.

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

              1 Reply Last reply
              0
              • avgjoecoderA avgjoecoder

                @SGaist

                Why do I need to compile qt? I only want to run my c++ app on the pi, not QT. Why do I need qt on the pi at all?? I was under the impression that once you cross compile your c++ into a binary, you could simply copy it to the pi and run it. Shouldn't all of the dependencies be compiled into the binary? Perhaps that is a bad assumption?

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

                @avgjoecoder "Shouldn't all of the dependencies be compiled into the binary? Perhaps that is a bad assumption?" - yes that is a bad assumption. It is simple: if your app is using a library (like any Qt library) - then you need that library for the target architecture/OS. That means if you want to use Qt for your RPI application you need Qt build for ARM/Linux (I guess you use Linux on RPI?), you cannot use Qt you installed on your Windows host because it is for x86/Windows.

                "Shouldn't all of the dependencies be compiled into the binary?" - I guess with this you mean static linking? Even in this case you need all the libraries you're using built for the target CPU/OS. For static linking you need static libraries. Shared libraries are not compiled into the executable!

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

                avgjoecoderA 1 Reply Last reply
                1
                • jsulmJ jsulm

                  @avgjoecoder "Shouldn't all of the dependencies be compiled into the binary? Perhaps that is a bad assumption?" - yes that is a bad assumption. It is simple: if your app is using a library (like any Qt library) - then you need that library for the target architecture/OS. That means if you want to use Qt for your RPI application you need Qt build for ARM/Linux (I guess you use Linux on RPI?), you cannot use Qt you installed on your Windows host because it is for x86/Windows.

                  "Shouldn't all of the dependencies be compiled into the binary?" - I guess with this you mean static linking? Even in this case you need all the libraries you're using built for the target CPU/OS. For static linking you need static libraries. Shared libraries are not compiled into the executable!

                  avgjoecoderA Offline
                  avgjoecoderA Offline
                  avgjoecoder
                  wrote on last edited by
                  #14

                  @jsulm

                  I am sure you know this better than I. I think I understand your confusion. You assumed that I wanted to use some of the QT libraries?? If so, that is not the case. Let's take a step back.

                  My first goal was to do what I thought would be simple. Use qtcreator on windows 7 to cross-compile a simple hello world app that runs on the pi. I don't want to include anything that would complicate this. I do not want to write/compile on the pi or use any more than is absolutely necessary to accomplish this first milestone.

                  Is that more clear?

                  jsulmJ 1 Reply Last reply
                  0
                  • avgjoecoderA avgjoecoder

                    @jsulm

                    I am sure you know this better than I. I think I understand your confusion. You assumed that I wanted to use some of the QT libraries?? If so, that is not the case. Let's take a step back.

                    My first goal was to do what I thought would be simple. Use qtcreator on windows 7 to cross-compile a simple hello world app that runs on the pi. I don't want to include anything that would complicate this. I do not want to write/compile on the pi or use any more than is absolutely necessary to accomplish this first milestone.

                    Is that more clear?

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

                    @avgjoecoder I understood you correctly (see again what I wrote before). You can use QtCreator as your IDE. You can cross compile on Windows for PI, but it is easier on Linux. I don't know how to do it on Windows, but there are sources on the internet.

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

                    1 Reply Last reply
                    0
                    • avgjoecoderA Offline
                      avgjoecoderA Offline
                      avgjoecoder
                      wrote on last edited by
                      #16

                      Looks like I'll have to give up on QT CReator for this. I was unable to find anything on the net that indicated success on Windows.

                      jsulmJ 1 Reply Last reply
                      0
                      • avgjoecoderA avgjoecoder

                        Looks like I'll have to give up on QT CReator for this. I was unable to find anything on the net that indicated success on Windows.

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

                        @avgjoecoder The problem is not QtCreator. QtCreator is an IDE which needs an working environment to build software. In your case you need a compiler and a sysroot for the target hardware. If the sysroot is not there you will not be able to build even on the command line.
                        I would suggest to install Linux in a virtual machine and do it there - it is much easier compared to Windows.

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

                        avgjoecoderA 1 Reply Last reply
                        0
                        • jsulmJ jsulm

                          @avgjoecoder The problem is not QtCreator. QtCreator is an IDE which needs an working environment to build software. In your case you need a compiler and a sysroot for the target hardware. If the sysroot is not there you will not be able to build even on the command line.
                          I would suggest to install Linux in a virtual machine and do it there - it is much easier compared to Windows.

                          avgjoecoderA Offline
                          avgjoecoderA Offline
                          avgjoecoder
                          wrote on last edited by
                          #18

                          @jsulm The problem is CONFIGURING QtCreator. Apparently no one here knows how to do that for windows to pi cross compile and debug. I gave up on QT and have succeeded to do just that with Eclipse, their suggested toolchain and detailed configuration docs. So for my purposes, no need to continue this thread.

                          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