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

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.7k 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.
  • S Offline
    S Offline
    SGaist
    Lifetime Qt Champion
    wrote on 21 Jul 2016, 22:49 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

    A 1 Reply Last reply 21 Jul 2016, 22:56
    0
    • S SGaist
      21 Jul 2016, 22:49

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

      A Offline
      A Offline
      avgjoecoder
      wrote on 21 Jul 2016, 22:56 last edited by
      #8

      @SGaist

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

      A 1 Reply Last reply 21 Jul 2016, 23:12
      0
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 21 Jul 2016, 22:58 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

        A 1 Reply Last reply 21 Jul 2016, 23:19
        0
        • A avgjoecoder
          21 Jul 2016, 22:56

          @SGaist

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

          A Offline
          A Offline
          avgjoecoder
          wrote on 21 Jul 2016, 23:12 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
          • S SGaist
            21 Jul 2016, 22:58

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

            A Offline
            A Offline
            avgjoecoder
            wrote on 21 Jul 2016, 23:19 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?

            J 2 Replies Last reply 22 Jul 2016, 04:57
            0
            • A avgjoecoder
              21 Jul 2016, 23:19

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

              J Offline
              J Offline
              jsulm
              Lifetime Qt Champion
              wrote on 22 Jul 2016, 04:57 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
              • A avgjoecoder
                21 Jul 2016, 23:19

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

                J Offline
                J Offline
                jsulm
                Lifetime Qt Champion
                wrote on 22 Jul 2016, 05:02 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

                A 1 Reply Last reply 22 Jul 2016, 19:38
                1
                • J jsulm
                  22 Jul 2016, 05:02

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

                  A Offline
                  A Offline
                  avgjoecoder
                  wrote on 22 Jul 2016, 19:38 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?

                  J 1 Reply Last reply 25 Jul 2016, 04:35
                  0
                  • A avgjoecoder
                    22 Jul 2016, 19:38

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

                    J Offline
                    J Offline
                    jsulm
                    Lifetime Qt Champion
                    wrote on 25 Jul 2016, 04:35 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
                    • A Offline
                      A Offline
                      avgjoecoder
                      wrote on 1 Aug 2016, 03:47 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.

                      J 1 Reply Last reply 1 Aug 2016, 05:12
                      0
                      • A avgjoecoder
                        1 Aug 2016, 03:47

                        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.

                        J Offline
                        J Offline
                        jsulm
                        Lifetime Qt Champion
                        wrote on 1 Aug 2016, 05:12 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

                        A 1 Reply Last reply 4 Aug 2016, 03:41
                        0
                        • J jsulm
                          1 Aug 2016, 05:12

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

                          A Offline
                          A Offline
                          avgjoecoder
                          wrote on 4 Aug 2016, 03:41 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

                          16/18

                          1 Aug 2016, 03:47

                          • Login

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