Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. cross compiling to android and arm
QtWS25 Last Chance

cross compiling to android and arm

Scheduled Pinned Locked Moved Unsolved General and Desktop
50 Posts 7 Posters 19.2k 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.
  • L Offline
    L Offline
    Lineaxe
    wrote on 3 Feb 2016, 00:55 last edited by
    #1

    Hi I have been going through all the information that I can find online on qt and cross compiling. I am most of the way through getting QT to recognize a KIT with an ARM processor. I have a kit that will compile to android , I just don't know how to do so yet. It does go through the comple. I just don't having anything to xfer over to the Android device ( it is recognized by QT I believe)

    1 Reply Last reply
    0
    • L Offline
      L Offline
      Lineaxe
      wrote on 3 Feb 2016, 19:13 last edited by
      #2

      OMG
      What a quagmire I have gotten myself into ... this is almost as bad as when a little while back I destroyed an O/S by installing something it didn't like. Well , I'm getting lots of reading in anyhow, and I did get Eclipse back in last night with remote systems. So I can test that the arm and android interfaces are working . Well , I have tested it that way in the past for the arm and created a dynamic library (.SO) that I use in QT. So , I know I can check out that arm is working properly that way before getting it going with QT.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 3 Feb 2016, 21:36 last edited by
        #3

        Hi,

        Maybe a silly question but if you have an Android running, why not use the Android Qt package ?

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

        1 Reply Last reply
        1
        • L Offline
          L Offline
          Lineaxe
          wrote on 4 Feb 2016, 06:29 last edited by
          #4

          Oh I am using the Android SDK and the NDK as instructed in some online documentation. My first time through this process, and I guess I haven't set something the right way. I will keep at it until ....

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 4 Feb 2016, 20:35 last edited by
            #5

            Did you install Qt for Android ?

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

            1 Reply Last reply
            0
            • X Offline
              X Offline
              Xicor
              wrote on 4 Feb 2016, 22:39 last edited by
              #6

              after setting up a kit (and making sure it likes it), there is a little button on the bottom left hand corner of qt creator that lets you select which kit to compile with.

              if you dont have things that only compile for android (like androidextras), you can just switch between desktop and android kits.

              1 Reply Last reply
              1
              • L Offline
                L Offline
                Lineaxe
                wrote on 16 Feb 2016, 08:51 last edited by
                #7

                Yup, I tracked the problem down to some missing dependencies. My first chance in over a week to get back at it , (I just got over the flu and some other mishaps ). I started to tackle the problem and found what was needed . I made sure that the latest version of ANT was in. Anyhow, I have finally compiled and deployed my first code over to the android. I am happy to see that QT recognized the USB device and I was able to select it as the default location to deploy my projects. I learned a lot of mumbo jumbo on how the files are being processed along the way !!! :) This first part is Solved for sure. Thanks everyone for your input!! And now I back on to the task setting up QT 3.6 (I like the UML modeling that is being developed for QT) using the latest version of ubuntu for cross compiling to another arm7 computer (with it's latest version of O/S & connected via IP address) . I think I got quite a bit of this setup correctly , I did make a kit that does have access to the arm gcc compiler . I also remember getting the arm code to cross compile using Eclipse on Ubuntu 14. So I will try to set up both QT and Eclipse right now.

                1 Reply Last reply
                1
                • L Offline
                  L Offline
                  Lineaxe
                  wrote on 16 Feb 2016, 09:51 last edited by
                  #8

                  Hey , how do I up my reputation ? I keep on clicking the Like button , but it don't go up .....

                  1 Reply Last reply
                  2
                  • S Offline
                    S Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on 16 Feb 2016, 23:18 last edited by
                    #9

                    What dependency was it ?

                    You don't up your own reputation. It's others that do so by e.g. up voting your questions or answers.

                    Since you have it working now, please mark the thread as solved using the "Topic Tool" button so other forum users may know a solution has been found :)

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

                    1 Reply Last reply
                    0
                    • L Offline
                      L Offline
                      Lineaxe
                      wrote on 17 Feb 2016, 12:38 last edited by
                      #10

                      I guess I started the thread with 2 questions and I should have separated them into different threads at the outset.
                      I could now start a new thread with just the arm cross compiling , if . Anyhow , when I looked up how to do it , I found several online Articles telling the to do stuff like

                      1. format and install the arm O/S from its iso file 2) Build Qt 5.5 on the remote arm machine ** or** combine it with an image created on Ubuntu machine and then send that image over to the arm machine 3) Have the remote machine create a qmake file 4) Have the ubuntu machine somehow use that qmake file inside of a kit 5) install the remote machine as a device and fil in the IP info ,password ,etc fields .Also fill in the location of the the cross compile chain , a sysroot , and so on fields. 5) Required on remote computer all libraries and make files 6) duplicate libraries and make files needed on Ubuntu machine to compile 7) a few other steps that I will be looking closer at ...
                        On the Eclipse machine to compile code using the same cross compile chain , I just needed to select the chain and choose the type of project that I wanted to compile . It would produce the arm code on the Ubuntu machine and then I just used the remote systems to send the executable files across via the arm machine's IP . Kinda reminded me a little of Filezilla sans it's extra features. Anyhow the whole process seemed a bit easier than what I have been reading about creating 2 Copies of QT and building one of them for the arm machine ,then creating qmake files on the remote , and well, heh , it seems like a monumental task. So I will be testing the whole thing with a different drive in the remote arm machine. Ask I probably mentioned b4 , I already crashed an O/S on that machine, and I am gonna probably do it again when I try to get the same libraries going. I guess I better burn an Image with everything I need on it before testing it all again :)
                      1 Reply Last reply
                      0
                      • S Offline
                        S Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on 17 Feb 2016, 21:42 last edited by
                        #11

                        What is the usual case e.g. for the Raspberry Pi:

                        1. Get the system image
                        2. Put it on an SD card
                        3. Start the Pi
                        4. Mount the root filesystem of the Pi using e.g. sshfs
                        5. Cross-compile Qt using the mounted root
                        6. Install (this should install the host tools on your host machine and the Qt libraries on the Pi)
                        7. Add a new version in Qt Creator and make a kit to use it
                        8. Setup the connection to the device so Qt Creator can copy the executable on the Pi and start it
                        9. Write code, compile and enjoy

                        The root filesystem part can also be done without the device but you will have to sync the device filesystem to copy the Qt libraries on it. To do that you either mount the device filesystem image or copy it's content in a folder of your choice.

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

                        1 Reply Last reply
                        0
                        • L Offline
                          L Offline
                          Lineaxe
                          wrote on 18 Feb 2016, 08:27 last edited by
                          #12

                          Now on your step 5 , Cross compile QT using the mounted root. You mean cross compile QT itself over to the Pi?
                          Also step 6, Install.... I already do have QT installed on the Ubuntu machine , a re-install would perform this task?
                          Gotta admit, in reading those online tutorials I had tons of questions like this? I try to read between the lines :)

                          Also , I have stopped liking myself for points !!

                          1 Reply Last reply
                          0
                          • jsulmJ Offline
                            jsulmJ Offline
                            jsulm
                            Lifetime Qt Champion
                            wrote on 18 Feb 2016, 11:50 last edited by
                            #13

                            Qt installed on your machine isn't of interest for Pi, so no reinstalling Qt on your Ubuntu machine will not change anything on Pi.

                            Regarding 5: yes you need to compile Qt for Pi and you use PIs file system for dependencies (since you're building for Pi).

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

                            1 Reply Last reply
                            0
                            • L Offline
                              L Offline
                              Lineaxe
                              wrote on 28 Feb 2016, 08:32 last edited by
                              #14

                              I have been doing some reading and testing out the steps described in articles from places like
                              http://hertaville.com/2014/04/12/cross-compiling-qt4-app/
                              http://www.ics.com/blog/building-qt-5-raspberry-pi#.U0l4fN3yOV4
                              and many other articles that I have found. Some of the steps the articles talk about have needed tweeking in order to work on my Ubuntu and Arm machines.
                              I have tested to make sure I can cross compile in my newer version of Eclipse. I have installed sshfs to access the arm machines files from Ubuntu file system. I documented my procedure so far , and everything installed and works ok until...
                              I am now finding that when I execute the following step in Ubuntu terminal I get an error.
                              sudo ln -s $HOME/rpi/mntrpi/usr/lib/arm-linux-gnueabihf/ /usr/lib/arm-linux-gnueabihf
                              ln: failed to create symbolic link ‘/usr/lib/arm-linux-gnueabihf/arm-linux-gnueabihf’: Permission denied

                              I opened nautilus as a root user and tried to change the folder permissions but was denied...
                              Do you know of any online resources that will get me through the rest of the process needed to get QT 3.6 cross compiling to arm? It looks like I need to do more reading to get this all going :)

                              1 Reply Last reply
                              0
                              • L Offline
                                L Offline
                                Lineaxe
                                wrote on 1 Mar 2016, 01:33 last edited by
                                #15

                                Got a chance to do some more reading. I solved last issue of not creating the symbolic links. Looks like Ubuntu needed a reboot , then in Ubuntu;s terminal I
                                rm /usr/lib/arm-linux-gnueabihf **
                                ** sudo ln -s $HOME/rpi/mntrpi/usr/lib/arm-linux-gnueabihf/ /usr/lib/arm-linux-gnueabihf

                                This got this part of halhertas tuturial tweaked to run on my system I guess I wasn't the root user when I originally got all the permission denied messages, I am glad they are gone now..

                                1 Reply Last reply
                                0
                                • L Offline
                                  L Offline
                                  Lineaxe
                                  wrote on 1 Mar 2016, 02:42 last edited by Lineaxe 3 Jul 2016, 05:17
                                  #16

                                  Well , I do believe I am cross compiling for arm .. Seems that I have installed for Qt 4 and not Qt 5 yet. Due to my reading and testing code from a few sources, I guess.
                                  But the following shows promise as it caught a missing QApplication error (.It sure looks like it wants to compile & build it's code directly onto the arm computer.)

                                  :~/rpi/qttest$ make
                                  arm-linux-gnueabihf-g++ -O0 -g -Wall -I./ -I/home/ubuntuUserName/rpi/mntrpi/usr/include/qt4/ -I/home/ubuntuUserName/rpi/mntrpi/usr/include/qt4/QtGui -c main.cpp
                                  main.cpp:1:24: fatal error: QApplication: No such file or directory
                                  #include <QApplication>
                                  ^
                                  compilation terminated.
                                  Makefile:40: recipe for target 'main.o' failed
                                  make: *** [main.o] Error 1

                                  Well , more reading for me :)

                                  1 Reply Last reply
                                  1
                                  • L Offline
                                    L Offline
                                    Lineaxe
                                    wrote on 1 Mar 2016, 03:11 last edited by
                                    #17

                                    This one was easy to fix...I reinstalled libqt4-dev on the arm computer. Now it all compiles through Ubuntu's terminal.. The last step it to make a kit inside Qtcreator 3.6 on the Ubuntu machine and I can mark this thread as Solved. Quite the interesting procedure so far. Getting to know my linux O/S 's better now as well :)

                                    1 Reply Last reply
                                    0
                                    • S Offline
                                      S Offline
                                      SGaist
                                      Lifetime Qt Champion
                                      wrote on 1 Mar 2016, 17:01 last edited by
                                      #18

                                      If you want to cross-compile from your computer, you need a cross-compiled version of Qt. The qmake from your Qt 4 installed on your ARM device can't be run by Qt Creator on your desktop machine.

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

                                      1 Reply Last reply
                                      0
                                      • L Offline
                                        L Offline
                                        Lineaxe
                                        wrote on 2 Mar 2016, 08:24 last edited by
                                        #19

                                        Ok , I guess that particular article isn't help me with cross compiling thru QT . The resources I have found online don't really cover cross compiling QT to arm very well.
                                        So he article below is not going to do it correctly then I guess ...

                                        "Cross Compiling Qt4 Applications for the Raspberry Pi
                                        Date Sat 12 April 2014 Tags Raspberry Pi / Qt / Cross compilation

                                        This blog post will demonstrate how to cross compile Qt4 applications for the Raspberry Pi (RPi). The approach taken in this entry is a little different from that taken by other tutorials such as this or this. The complete cross compilation of the Qt4 or Qt5 libraries will NOT be covered. Instead, the Qt4 libraries available in the Raspbian's repos will be installed on the Raspberry Pi and the RPi's root filesystem will then be mounted onto the PC over the network using SSHFS. The RPi's cross compiling toolchain will then build qt apps by compiling Qt4 source code on the PC and linking it to the Qt4 libraries available via the SSHFS-mounted RPi filesystem. "

                                        I don't know if this article will do it either.

                                        " Building Qt 5 on Raspberry Pi
                                        By David Johnson | Friday, May 17, 2013
                                        3510

                                        Raspberry Pi This is a HOW TO guide for building Qt 5 for the Raspberry Pi, and building and deploying Qt 5 apps using Qt Creator. This guide will be using Raspbian “Wheezy”, a Debian based distro designed for the Raspberry Pi. This guide also assumes the use of Linux or UNIX on the workstation side."

                                        Or this one , since it only describes compiling for eclipse

                                        " Development Environment for the Raspberry Pi using a Cross Compiling Toolchain and Eclipse "

                                        I also read over this one .... Is this along the lines of what should be done ?

                                        Guide To Cross Compile Qt 5.4 for the Raspberry Pi

                                        Overview:

                                        This guide will explain how to install Qt 5.4 on theRaspberry Pi. The following topics will be discussed. Finding a suitable tool chain, downloading the Raspbian OS image, mounting the image, downloading Qt 5.4, compiling Qt 5.4, and adding the Raspberry Pi as a device inside Qt Creator.

                                        1 Reply Last reply
                                        1
                                        • L Offline
                                          L Offline
                                          Lineaxe
                                          wrote on 2 Mar 2016, 08:42 last edited by
                                          #20

                                          Hmm , this article won't do it either since it only talks about cross compiling from windows...

                                          "Cross-compiling Qt Embedded 5.5 for Raspberry Pi 2"

                                          This one has useful information that I bet is used somewhere in the process, but has no examples and leaves me with more questions than answers.
                                          "
                                          Qt for Embedded Linux

                                          With the release of Qt 5.0, Qt no longer contains its own window system implementation: QWS is no longer a supported platform. For single-process use cases, the Qt Platform Abstraction is a superior solution. Multiple graphical processes will be supported through Wayland. "

                                          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