cross compiling to android and arm
-
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 :)
-
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- 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 :)
- 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 ...
-
What is the usual case e.g. for the Raspberry Pi:
- Get the system image
- Put it on an SD card
- Start the Pi
- Mount the root filesystem of the Pi using e.g. sshfs
- Cross-compile Qt using the mounted root
- Install (this should install the host tools on your host machine and the Qt libraries on the Pi)
- Add a new version in Qt Creator and make a kit to use it
- Setup the connection to the device so Qt Creator can copy the executable on the Pi and start it
- 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.
-
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 !!
-
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).
-
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 deniedI 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 :) -
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-gnueabihfThis 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..
-
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 1Well , more reading for me :)
-
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 :)
-
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.
-
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 compilationThis 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
3510Raspberry 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.
-
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 LinuxWith 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. "
-
Heh, No wonder I get confused... here is some excerpts from
"Guide To Cross Compile Qt 5.4 for the Raspberry Pi" and what I am finding out...The “arm-bcm2708” folder contains the cross-compiler. More on this in a bit. We will now get some tools that will make our jobs easier when building Qt for the Pi.
- cd ..
- sudo git clone git://gitorious.org/cross-compile-tools/cross-compile-tools.git
This responded with the following:
Cloning into 'cross-compile-tools'...
fatal: unable to connect to gitorious.org:
gitorious.org[0: 2a02:c0:1014::1]: errno=Connection timed out
gitorious.org[1: 64.13.172.37]: errno=Connection refusedLooking into the problem a bit further I find the following online at http://blog.gitorious.org
Gitorious.org is dead, long live gitorious.org...
As you may know, Gitorious was acquired by GitLab about a month ago, and we announced that Gitorious.org would be shutting down at the end of May, 2015.Ok, so I am trying to get a copy of files as a zip from
https://github.com/shahriman/cross-compile-tools and put the files from it into the cross-compile dir that I created. so that I can now go on to setting up a root filepath on Ubuntu for mounting the arm image onto . Somehow , I am wondering if it's all going to compile across to the arm , but hopefully I am on the right track with this article now.
I -
Well , I got an error message on this step , I cd'd to the directory of the image and reduced the command down to . This calculation of size 67108864 was checked . It** should** set the filepath to img.
** sudo mount –o loop, offset=67108864 2016-02-26-raspbian-jessie.img /mnt/rasp-pi-rootfs **
Returns with error:
Usage:
mount [-lhV]
mount -a [options]
mount [options] [--source] <source> | [--target] <directory>
mount [options] <source> <directory>
mount <operation> <mountpoint> [<target>]
Mount a filesystem.So, I don't know what it wants from me now . I have given it everything !!!
My blood, my sweat , my tears !!!! My HAIR !!!! ..... -
Might be wrong but IIRC there should be no space between the comma an offset
-
For the record (and for anyone else who may be working wth cross compiling to Jessie ) the syntax to make the command execute in terminal is below.
( I did try quite a few ways of changing the syntax from the article's example ) . Just before I crashed out last night I was thinking it needed another comma as well, placed just before the path to the image.
So I removed the space after the first comma , and added a second and now this syntax will work.
sudo mount –o loop,offset=67108864,2016-02-26-raspbian-jessie.img /mnt/rasp-pi-rootfsThanks again, I am getting soooo close now :) One day I might be even able to answer some of the simpler questions in this forum ( no guaranteeing the answers I post :)
-
Ok well , I thought I got a result with the following line , however after inspecting inside the mnt directory It didn't do anything to rasp-pi-rootfs , and it now flags the same error as I have had before.
( Maybe I had looked in the wrong terminal window after I executed the line , I did have a couple open )
sudo mount –o loop,offset=67108864,2016-02-26-raspbian-jessie.img /mnt/rasp-pi-rootfsSorry, the above won't work. I am now testing all other sorts of syntax's out while rereading the man pages on the mount command :) ... Syntax must be fairly close to what mount will accept .
-
This syntax works ,and the files in the directory show up . It came from a different example using mount.
So the finally corrected syntax seems to be:
sudo mount -v -o loop,offset=67108864 -t ext4 2016-02-26-raspbian-jessie.img /mnt/rasp-pi-rootfs
and it returns with the following
mount: /dev/loop0 mounted on /mnt/rasp-pi-rootfs. -
I made it to the compiling of QT phase , Here I couldn't get it to compile without errors. The article I read uses 5.4 ,but I only had 5.5 or 5.6 so I used 5.6.
./configure -opengl es2 -device linux-rasp-pi-g++ -device-option CROSS_COMPILE=$RPI_TOOLCHAIN -sysroot $RPI_SYSROOT -opensource -confirm-license -optimized-qmake -reduce-exports -release -make libs -prefix /usr/local/qt5pi -skip qtwebkitWhen I ran the command above it returned with (an error)
Attempting to skip non-existent module qtwebkit.
When I removed the -skip qtwebkit portion it started to compile like it should be doing ,but it came up with errors.
a usr/local/ folder wasn't found .. and I don't think it went through the process properly . Does it then increase the size of the .img after Qt Creator is compiled for it , I would think it does...H... E... L... P?