cross compiling to android and arm



  • 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)



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


  • Lifetime Qt Champion

    Hi,

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



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


  • Lifetime Qt Champion

    Did you install Qt for Android ?



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



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



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


  • Lifetime Qt Champion

    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

    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 :)

  • Lifetime Qt Champion

    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.



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


  • Moderators

    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 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 :)



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



  • 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 :)



  • 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 :)


  • Lifetime Qt Champion

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



  • 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. "



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

    1. cd ..
    2. 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 refused

    Looking 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 !!!! .....


  • Lifetime Qt Champion

    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-rootfs

    Thanks 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-rootfs

    Sorry, 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 qtwebkit

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

  • administrators

    Hi, I'm useless in the technical context of this thread, but found it to be the best user story on how to get started with Qt on Pi.

    I'm pretty sure you have gone through the Qt wiki page about this:
    https://wiki.qt.io/Raspberrypi_beginners_guide
    Would it be too much to ask if you can update that page if it has something that doesn't make sense?

    P.S. maybe change the thread topic now that it's not so much about Android?



  • Well, I do have some notes on the side I could add in as well I suppose. Once I make it to the end I will add in the info , Start a new thread on Cross compiling from Ubuntu 15.10 (wily) to arm 6 (Pi in this case) . I also want to update my notes on the Android and put it all into a separate thread on Creating code on Ubuntu 15 and deploying it to the Android. There were some steps on installing the latest version of Ant & other things that I had done that aren't mentioned in this thread.



  • Well , I tried a couple of things again last night to see if I could compile Qt to the .img without errors. No luck ,so far... I am installing 5.4 now as it's the one used in the article , it might get rid of any errors that might have to do with the nonexistant qtwebkit.
    Time to get my broccoli,tomato,lettuce & Pepper seeds into starter soil. I want them all a few inches tall b4 I put them outside.



  • Ok , I got as far as make ... the config command worked with Qt 5.4... running make started compiling until it returned the following errors, which I found out were broken links in /mnt/rasp-pi-rootfs/usr/lib/arm-linux-gnueabihf/. Not sure what to do , I will try to find out how to fix the broken links . Maybe I missed something along the way. ( The Saga continues...)

    /home/ubuntuUserName/rpi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld.gold: error: cannot open /mnt/rasp-pi-rootfs/usr/lib/arm-linux-gnueabihf/libz.so: No such file or directory
    /home/ubuntuUserName/rpi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld.gold: error: cannot open /mnt/rasp-pi-rootfs/usr/lib/arm-linux-gnueabihf/libdl.so: No such file or directory
    /home/ubuntuUserName/rpi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld.gold: error: cannot open /mnt/rasp-pi-rootfs/usr/lib/arm-linux-gnueabihf/librt.so: No such file or directory
    /home/ubuntuUserName/rpi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld.gold: error: cannot open /mnt/rasp-pi-rootfs/usr/lib/arm-linux-gnueabihf/libm.so: No such file or directory
    .obj/qlibrary_unix.o:qlibrary_unix.cpp:function qdlerror(): error: undefined reference to 'dlerror'
    .obj/qlibrary_unix.o:qlibrary_unix.cpp:function QLibraryPrivate::unload_sys(): error: undefined reference to 'dlclose'
    .obj/qlibrary_unix.o:qlibrary_unix.cpp:function qt_linux_find_symbol_sys(char const*): error: undefined reference to 'dlsym'
    .obj/qlibrary_unix.o:qlibrary_unix.cpp:function QLibraryPrivate::resolve_sys(char const*): error: undefined reference to 'dlsym'
    .obj/qlibrary_unix.o:qlibrary_unix.cpp:function QLibraryPrivate::load_sys(): error: undefined reference to 'dlopen'
    .obj/qbytearray.o:qbytearray.cpp:function qUncompress(unsigned char const*, int): error: undefined reference to 'uncompress'
    .obj/qbytearray.o:qbytearray.cpp:function qCompress(unsigned char const*, int, int): error: undefined reference to 'compress2'
    .obj/qdatetime.o:qdatetime.cpp:function fromIsoTimeString(QStringRef const&, Qt::DateFormat, bool*): error: undefined reference to 'pow'
    .obj/qdatetime.o:qdatetime.cpp:function fromIsoTimeString(QStringRef const&, Qt::DateFormat, bool*): error: undefined reference to 'floorf'
    .obj/qdatetime.o:qdatetime.cpp:function fromIsoTimeString(QStringRef const&, Qt::DateFormat, bool*): error: undefined reference to 'pow'
    .obj/qeasingcurve.o:qeasingcurve.cpp:function easeInOutCirc(double): error: undefined reference to 'sqrt'
    .obj/qeasingcurve.o:qeasingcurve.cpp:function easeInOutCirc(double): error: undefined reference to 'sqrt'
    .obj/qeasingcurve.o:qeasingcurve.cpp:function easeOutCirc(double): error: undefined reference to 'sqrt'
    .obj/qeasingcurve.o:qeasingcurve.cpp:function easeInCirc(double): error: undefined reference to 'sqrt'
    .obj/qeasingcurve.o:qeasingcurve.cpp:function easeSineCurve(double): error: undefined reference to 'sin'
    .obj/qeasingcurve.o:qeasingcurve.cpp:function easeOutSine(double): error: undefined reference to 'sin'
    .obj/qeasingcurve.o:qeasingcurve.cpp:function easeOutCurve(double): error: undefined reference to 'sin'
    .obj/qeasingcurve.o:qeasingcurve.cpp:function easeCosineCurve(double): error: undefined reference to 'cos'
    .obj/qeasingcurve.o:qeasingcurve.cpp:function easeInOutSine(double): error: undefined reference to 'cos'
    .obj/qeasingcurve.o:qeasingcurve.cpp:function easeOutInSine(double): error: undefined reference to 'cos'
    .obj/qeasingcurve.o:qeasingcurve.cpp:function easeOutInSine(double): error: undefined reference to 'sin'
    .obj/qeasingcurve.o:qeasingcurve.cpp:function easeInOutExpo(double): error: undefined reference to 'pow'
    .obj/qeasingcurve.o:qeasingcurve.cpp:function easeInOutExpo(double): error: undefined reference to 'pow'
    .obj/qeasingcurve.o:qeasingcurve.cpp:function easeInSine(double): error: undefined reference to 'cos'
    .obj/qeasingcurve.o:qeasingcurve.cpp:function ElasticEase::value(double): error: undefined reference to 'asin'
    .obj/qeasingcurve.o:qeasingcurve.cpp:function ElasticEase::value(double): error: undefined reference to 'asin'
    .obj/qeasingcurve.o:qeasingcurve.cpp:function ElasticEase::value(double): error: undefined reference to 'asin'
    .obj/qeasingcurve.o:qeasingcurve.cpp:function ElasticEase::value(double): error: undefined reference to 'asin'
    .obj/qline.o:qline.cpp:function QLineF::angle() const: error: undefined reference to 'atan2'
    .obj/qline.o:qline.cpp:function QLineF::setAngle(double): error: undefined reference to 'sincos'
    .obj/qline.o:qline.cpp:function QLineF::fromPolar(double, double): error: undefined reference to 'sincos'
    .obj/qline.o:qline.cpp:function QLineF::angle(QLineF const&) const: error: undefined reference to 'acos'
    .obj/qlocale_tools.o:qlocale_tools.cpp:function qdtoa(double, int, int, int*, int*, char**, char**): error: undefined reference to 'feholdexcept'
    .obj/qlocale_tools.o:qlocale_tools.cpp:function qdtoa(double, int, int, int*, int*, char**, char**): error: undefined reference to 'fesetenv'
    .obj/qrect.o:qrect.cpp:function QRectF::toAlignedRect() const: error: undefined reference to 'floor'
    .obj/qrect.o:qrect.cpp:function QRectF::toAlignedRect() const: error: undefined reference to 'ceil'
    .obj/qrect.o:qrect.cpp:function QRectF::toAlignedRect() const: error: undefined reference to 'floor'
    .obj/qrect.o:qrect.cpp:function QRectF::toAlignedRect() const: error: undefined reference to 'ceil'
    .obj/qtimeline.o:qtimeline.cpp:function QTimeLine::frameForTime(int) const: error: undefined reference to 'ceil'
    collect2: error: ld returned 1 exit status
    Makefile:1255: recipe for target '../../lib/libQt5Core.so.5.4.2' failed
    make[3]: *** [../../lib/libQt5Core.so.5.4.2] Error 1
    make[3]: Leaving directory '/home/ubuntuUserName/Qt/5.4/Src/qtbase/src/corelib'
    Makefile:142: recipe for target 'sub-corelib-make_first' failed
    make[2]: *** [sub-corelib-make_first] Error 2
    make[2]: Leaving directory '/home/ubuntuUserName/Qt/5.4/Src/qtbase/src'
    Makefile:45: recipe for target 'sub-src-make_first' failed
    make[1]: *** [sub-src-make_first] Error 2
    make[1]: Leaving directory '/home/ubuntuUserName/Qt/5.4/Src/qtbase'
    Makefile:68: recipe for target 'module-qtbase-make_first' failed
    make: *** [module-qtbase-make_first] Error 2

    DId I mention error ?


  • Lifetime Qt Champion

    Did you check that your mount is working correctly and that you have access to it ?



  • I have checked my mount to make sure that I have access. I just now sudo'd nautilus and set the mount permission to allow complete access to all files & folders for everyone. ran config and make again, Same errors . I am thinking My next move is to find a copy of the older O/S (7.9) that Qt 5.4 was being compiled for as described in the article. It would be nice to have the make work with O/S version 8+ at some point,I guess. Well , I still learned tons to date, so I will just have to backtrack and run through the steps again. :)



  • Well my fertilizer and compost is in, my seeds are planted and receiving their first bit of warm light. Anyhow, I tested the steps on an earlier O/S for arm6 (7.2) and it would not compile either , with same errors. So I read (somewhere in the terminal output that was generated from the make command ) about having to remove old files from previous build before reconfiguring the Qt 5.4 source files for build. The command that it seems it needed was:
    make clean

    --from the original article the make install command came up with the same errors as well.
    and I also tried
    sudo make clean install
    This is the last step needed in the Qt compile phase so if I get the right syntax... I did those last tests a couple of days ago, so I am now back at it for the week again.Who knows what I will discover ...
    Another Continent ?



  • here is the output error from running ** make install** in ubuntu's terminal. ( it seems have found the libz.so when i ran make clean first, just after ./config )
    /home/ubuntuUserName/rpi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld.gold: error: cannot open /mnt/rasp-pi-rootfs/usr/lib/arm-linux-gnueabihf/libz.so: No such file or directory
    /home/ubuntuUserName/rpi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld.gold: error: cannot open /mnt/rasp-pi-rootfs/usr/lib/arm-linux-gnueabihf/libdl.so: No such file or directory
    /home/ubuntuUserName/rpi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld.gold: error: cannot open /mnt/rasp-pi-rootfs/usr/lib/arm-linux-gnueabihf/librt.so: No such file or directory
    /home/ubuntuUserName/rpi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld.gold: error: cannot open /mnt/rasp-pi-rootfs/usr/lib/arm-linux-gnueabihf/libm.so: No such file or directory
    .obj/qlibrary_unix.o:qlibrary_unix.cpp:function qdlerror(): error: undefined reference to 'dlerror'
    .obj/qlibrary_unix.o:qlibrary_unix.cpp:function QLibraryPrivate::unload_sys(): error: undefined reference to 'dlclose'
    .obj/qlibrary_unix.o:qlibrary_unix.cpp:function qt_linux_find_symbol_sys(char const*): error: undefined reference to 'dlsym'
    .obj/qlibrary_unix.o:qlibrary_unix.cpp:function QLibraryPrivate::resolve_sys(char const*): error: undefined reference to 'dlsym'
    .obj/qlibrary_unix.o:qlibrary_unix.cpp:function QLibraryPrivate::load_sys(): error: undefined reference to 'dlopen'
    .obj/qbytearray.o:qbytearray.cpp:function qUncompress(unsigned char const*, int): error: undefined reference to 'uncompress'
    .obj/qbytearray.o:qbytearray.cpp:function qCompress(unsigned char const*, int, int): error: undefined reference to 'compress2'
    .obj/qdatetime.o:qdatetime.cpp:function fromIsoTimeString(QStringRef const&, Qt::DateFormat, bool*): error: undefined reference to 'pow'
    .obj/qdatetime.o:qdatetime.cpp:function fromIsoTimeString(QStringRef const&, Qt::DateFormat, bool*): error: undefined reference to 'floorf'
    .obj/qdatetime.o:qdatetime.cpp:function fromIsoTimeString(QStringRef const&, Qt::DateFormat, bool*): error: undefined reference to 'pow'
    .obj/qeasingcurve.o:qeasingcurve.cpp:function easeInOutCirc(double): error: undefined reference to 'sqrt'
    .obj/qeasingcurve.o:qeasingcurve.cpp:function easeInOutCirc(double): error: undefined reference to 'sqrt'
    .obj/qeasingcurve.o:qeasingcurve.cpp:function easeOutCirc(double): error: undefined reference to 'sqrt'
    .obj/qeasingcurve.o:qeasingcurve.cpp:function easeInCirc(double): error: undefined reference to 'sqrt'
    .obj/qeasingcurve.o:qeasingcurve.cpp:function easeSineCurve(double): error: undefined reference to 'sin'
    .obj/qeasingcurve.o:qeasingcurve.cpp:function easeOutSine(double): error: undefined reference to 'sin'
    .obj/qeasingcurve.o:qeasingcurve.cpp:function easeOutCurve(double): error: undefined reference to 'sin'
    .obj/qeasingcurve.o:qeasingcurve.cpp:function easeCosineCurve(double): error: undefined reference to 'cos'
    .obj/qeasingcurve.o:qeasingcurve.cpp:function easeInOutSine(double): error: undefined reference to 'cos'
    .obj/qeasingcurve.o:qeasingcurve.cpp:function easeOutInSine(double): error: undefined reference to 'cos'
    .obj/qeasingcurve.o:qeasingcurve.cpp:function easeOutInSine(double): error: undefined reference to 'sin'
    .obj/qeasingcurve.o:qeasingcurve.cpp:function easeInOutExpo(double): error: undefined reference to 'pow'
    .obj/qeasingcurve.o:qeasingcurve.cpp:function easeInOutExpo(double): error: undefined reference to 'pow'
    .obj/qeasingcurve.o:qeasingcurve.cpp:function easeInSine(double): error: undefined reference to 'cos'
    .obj/qeasingcurve.o:qeasingcurve.cpp:function ElasticEase::value(double): error: undefined reference to 'asin'
    .obj/qeasingcurve.o:qeasingcurve.cpp:function ElasticEase::value(double): error: undefined reference to 'asin'
    .obj/qeasingcurve.o:qeasingcurve.cpp:function ElasticEase::value(double): error: undefined reference to 'asin'
    .obj/qeasingcurve.o:qeasingcurve.cpp:function ElasticEase::value(double): error: undefined reference to 'asin'
    .obj/qline.o:qline.cpp:function QLineF::angle() const: error: undefined reference to 'atan2'
    .obj/qline.o:qline.cpp:function QLineF::setAngle(double): error: undefined reference to 'sincos'
    .obj/qline.o:qline.cpp:function QLineF::fromPolar(double, double): error: undefined reference to 'sincos'
    .obj/qline.o:qline.cpp:function QLineF::angle(QLineF const&) const: error: undefined reference to 'acos'
    .obj/qlocale_tools.o:qlocale_tools.cpp:function qdtoa(double, int, int, int*, int*, char**, char**): error: undefined reference to 'feholdexcept'
    .obj/qlocale_tools.o:qlocale_tools.cpp:function qdtoa(double, int, int, int*, int*, char**, char**): error: undefined reference to 'fesetenv'
    .obj/qrect.o:qrect.cpp:function QRectF::toAlignedRect() const: error: undefined reference to 'floor'
    .obj/qrect.o:qrect.cpp:function QRectF::toAlignedRect() const: error: undefined reference to 'ceil'
    .obj/qrect.o:qrect.cpp:function QRectF::toAlignedRect() const: error: undefined reference to 'floor'
    .obj/qrect.o:qrect.cpp:function QRectF::toAlignedRect() const: error: undefined reference to 'ceil'
    .obj/qtimeline.o:qtimeline.cpp:function QTimeLine::frameForTime(int) const: error: undefined reference to 'ceil'
    .obj/qelapsedtimer_unix.o:qelapsedtimer_unix.cpp:function qt_gettime(): error: undefined reference to 'clock_gettime'
    .obj/qelapsedtimer_unix.o:qelapsedtimer_unix.cpp:function QElapsedTimer::start(): error: undefined reference to 'clock_gettime'
    .obj/qelapsedtimer_unix.o:qelapsedtimer_unix.cpp:function QElapsedTimer::restart(): error: undefined reference to 'clock_gettime'
    .obj/qelapsedtimer_unix.o:qelapsedtimer_unix.cpp:function QElapsedTimer::nsecsElapsed() const: error: undefined reference to 'clock_gettime'
    collect2: error: ld returned 1 exit status
    Makefile:1255: recipe for target '../../lib/libQt5Core.so.5.4.2' failed
    make[3]: *** [../../lib/libQt5Core.so.5.4.2] Error 1
    make[3]: Leaving directory '/home/ubuntuUserName/Qt/5.4/Src/qtbase/src/corelib'
    Makefile:154: recipe for target 'sub-corelib-install_subtargets' failed
    make[2]: *** [sub-corelib-install_subtargets] Error 2
    make[2]: Leaving directory '/home/ubuntuUserName/Qt/5.4/Src/qtbase/src'
    Makefile:57: recipe for target 'sub-src-install_subtargets' failed
    make[1]: *** [sub-src-install_subtargets] Error 2
    make[1]: Leaving directory '/home/ubuntuUserName/Qt/5.4/Src/qtbase'
    Makefile:80: recipe for target 'module-qtbase-install_subtargets' failed
    make: *** [module-qtbase-install_subtargets] Error 2



  • i think before executing /configure & make command you should fix symbolic link and broken library path. i too faced similar problem 2 days ago not exactly the same but similar.



  • Hi , thanks for your reply, How do I go about fixing the symbolic link & library path. I don't know enough about compiling the source for Qt to fix these problems.



  • hi, you have to clone a cross compile repository it must be mentioned in whatever manual or steps you are following for cross compilation . From that cloned repository you have to run a script for fixing broken links and path.
    please post all the errors you face in this cross-compilation battle because i myself have spent almost 10 days in this process and i just wanna know how many errors are possible in this process.



  • Nice to know I am not struggling on alone here...Here is the link to the article I have been working from...
    http://exploreembedded.tumblr.com/post/115333857238/guide-to-cross-compile-qt-54-for-the-raspberry-pi
    I had been trying these steps out with Qt/5.4/Src and Qt/5.6/Src . I tested both Debian 8 and 7 O/S's for arm6 computer. I am using a Ubuntu 15 machine with a 64 bit O/S .
    Phoenix you mentioned cloning the cross compile repository . I copy my results of trying out that step described in the online article.
    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 refused

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

    ( I locate and d/l 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 directory which I had previously created) but I don't know if it contains the exact files , it does contain the /home/UbuntuUser/rpi/cross-compile-tools/fixQualifiedLibraryPaths file. I later ran the command from the cross-compile-tools folder with no errors. I copy the terminal results.
    ./fixQualifiedLibraryPaths /mnt/rasp-pi-rootfs ~/rpi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc
    Passed valid toolchain
    Adjusting the symlinks in /mnt/rasp-pi-rootfs/usr/lib to be relative
    Testing for existence of potential debian multi-arch dir: /mnt/rasp-pi-rootfs/usr/lib/arm-linux-gnueabihf
    Debian multiarch dir exists, adjusting
    Adjusting the symlinks in /mnt/rasp-pi-rootfs/usr/lib/arm-linux-gnueabihf to be relative



  • https://github.com/shahriman/cross-compile-tools.git contains the same content,

    so still the same error at /make step?????????


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.