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. Cross compile from Ubuntu Desktop to Raspberry Pi 2
QtWS25 Last Chance

Cross compile from Ubuntu Desktop to Raspberry Pi 2

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
22 Posts 10 Posters 12.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.
  • J Offline
    J Offline
    JanisK
    wrote on 13 Feb 2017, 20:10 last edited by
    #3

    @jsulm - thanks for the reply.

    I tried to run ldd /home/janisk/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libicui18n.so.52 and got this:
    not a dynamic executable

    But I tried with version 5.7 instead of 5.8 (git clone git://code.qt.io/qt/qtbase.git -b 5.7) and then the rest commands from tutorial, and everything works in 5.7 with no problems.

    1 Reply Last reply
    0
    • P Offline
      P Offline
      peterlin82
      wrote on 15 Feb 2017, 01:15 last edited by
      #4

      I have the same problem too.

      Qt Creator compile any example:
      libicui18n.so.52: undefined reference to `__cxa_throw_bad_array_new_length@CXXABI_1.3.8'

      Raspberry Pi2,2017-01-11-raspbian-jessie.zip,Qt 5.8.0

      I don know how to solve it.

      J 1 Reply Last reply 15 Feb 2017, 05:49
      0
      • P peterlin82
        15 Feb 2017, 01:15

        I have the same problem too.

        Qt Creator compile any example:
        libicui18n.so.52: undefined reference to `__cxa_throw_bad_array_new_length@CXXABI_1.3.8'

        Raspberry Pi2,2017-01-11-raspbian-jessie.zip,Qt 5.8.0

        I don know how to solve it.

        J Offline
        J Offline
        jsulm
        Lifetime Qt Champion
        wrote on 15 Feb 2017, 05:49 last edited by
        #5

        @peterlin82 Check the dependencies for libicui18n.so.52 using ldd, looks like a library is missing.

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

        1 Reply Last reply
        0
        • P Offline
          P Offline
          peterlin82
          wrote on 15 Feb 2017, 06:31 last edited by
          #6

          In Raspberry Pi 2
          ldd /usr/lib/arm-linux-gnueabihf/libicui18n.so.52

          linux-vdso.so.1 (0x7ee13000)
          /usr/lib/arm-linux-gnueabihf/libarmmem.so (0x76dc6000)
          libicuuc.so.52 => /usr/lib/arm-linux-gnueabihf/libicuuc.so.52 (0x76c66000)
          libicudata.so.52 => /usr/lib/arm-linux-gnueabihf/libicudata.so.52 (0x755e9000)
          libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0x755d6000)
          libstdc++.so.6 => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0x754fa000)
          libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0x7547f000)
          libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0x75451000)
          libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0x75310000)
          /lib/ld-linux-armhf.so.3 (0x54b69000)

          1 Reply Last reply
          0
          • F Offline
            F Offline
            Fifkie
            wrote on 16 Feb 2017, 08:47 last edited by Fifkie
            #7

            Hey!

            I have the same error when i try to compile qt 5.8 for raspberry pi 3.

            i get the same results as @peterlin82 and @JanisK when trying the ldd /usr/lib/arm-linux-gnueabihf/libicui18n.so.52 on RPI 3 and on Ubuntu.

            I'm not sure what to tell of it, don't get any obvious errors what i can see.

            J 1 Reply Last reply 16 Feb 2017, 08:53
            0
            • F Fifkie
              16 Feb 2017, 08:47

              Hey!

              I have the same error when i try to compile qt 5.8 for raspberry pi 3.

              i get the same results as @peterlin82 and @JanisK when trying the ldd /usr/lib/arm-linux-gnueabihf/libicui18n.so.52 on RPI 3 and on Ubuntu.

              I'm not sure what to tell of it, don't get any obvious errors what i can see.

              J Offline
              J Offline
              jsulm
              Lifetime Qt Champion
              wrote on 16 Feb 2017, 08:53 last edited by
              #8

              @Fifkie @JanisK Not sure it will help: https://github.com/raspberrypi/tools/issues/41

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

              F 1 Reply Last reply 18 Feb 2017, 00:16
              0
              • J jsulm
                16 Feb 2017, 08:53

                @Fifkie @JanisK Not sure it will help: https://github.com/raspberrypi/tools/issues/41

                F Offline
                F Offline
                Fifkie
                wrote on 18 Feb 2017, 00:16 last edited by
                #9

                @jsulm I can't really find anything usefull for me, but i might be missing something...

                1 Reply Last reply
                0
                • J Offline
                  J Offline
                  jayakody2000lk
                  wrote on 19 Feb 2017, 16:22 last edited by
                  #10

                  I also got the same error when cross compile Qt samples for Raspberry Pi 3 on Ubuntu 16.04 (64-bit). I'm using Qt Creator 5.8.

                  I got this error on both Raspbian 1.1 and Ubuntu Mate 16.04.2.

                  1 Reply Last reply
                  0
                  • H Offline
                    H Offline
                    hubaiz
                    wrote on 21 Feb 2017, 18:33 last edited by
                    #11

                    I managed to cross compile Qt 5.8 for the Raspberry Pi 3 (latest Raspbian) with the xbomber tip from this post (at the end): https://github.com/raspberrypi/tools/issues/50
                    Was following the EGLFS guide ( https://wiki.qt.io/RaspberryPi2EGLFS ) on a Linux Mint 17.3 x64 virtual machine.
                    I used the linux-rasp-pi2-g++ device configuration and the arm-rpi-4.9.3-linux-gnueabihf toolchain.
                    Used the Qt 5.8 source tar.gz without the qtserialbus and qtwebengine

                    F 1 Reply Last reply 23 Feb 2017, 11:14
                    0
                    • H hubaiz
                      21 Feb 2017, 18:33

                      I managed to cross compile Qt 5.8 for the Raspberry Pi 3 (latest Raspbian) with the xbomber tip from this post (at the end): https://github.com/raspberrypi/tools/issues/50
                      Was following the EGLFS guide ( https://wiki.qt.io/RaspberryPi2EGLFS ) on a Linux Mint 17.3 x64 virtual machine.
                      I used the linux-rasp-pi2-g++ device configuration and the arm-rpi-4.9.3-linux-gnueabihf toolchain.
                      Used the Qt 5.8 source tar.gz without the qtserialbus and qtwebengine

                      F Offline
                      F Offline
                      Fifkie
                      wrote on 23 Feb 2017, 11:14 last edited by
                      #12

                      @hubaiz Looking promising!
                      I just wonder, the second script, is there anything else i need to change than the path to tools and sysroot when targeting qt5.8 and raspberry 3?

                      i changed the paths and ran the script in qtbase but got errors.

                      Running configuration tests...
                      Checking for valid makespec... 
                      + cd /home/christian/raspi/qtbase/config.tests/common/verifyspec && /home/christian/raspi/qtbase/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared console" "QMAKE_CFLAGS += --sysroot=/home/christian/raspi/sysroot" "QMAKE_CXXFLAGS += --sysroot=/home/christian/raspi/sysroot" "QMAKE_LFLAGS += --sysroot=/home/christian/raspi/sysroot" -early "CONFIG += cross_compile" /home/christian/raspi/qtbase/config.tests/common/verifyspec
                      + cd /home/christian/raspi/qtbase/config.tests/common/verifyspec && MAKEFLAGS= /usr/bin/make clean && MAKEFLAGS= /usr/bin/make
                      > rm -f verifyspec.o
                      > rm -f *~ core *.core
                      > /home/christian/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -c -pipe -marm -mfpu=vfp -mtune=arm1176jzf-s -march=armv6zk -mabi=aapcs-linux -mfloat-abi=hard --sysroot=/home/christian/raspi/sysroot --sysroot=/home/christian/raspi/sysroot -O2 -std=gnu++11 -Wall -W -fPIC  -I. -I/home/christian/raspi/qtbase/mkspecs/devices/linux-rasp-pi-g++ -o verifyspec.o verifyspec.cpp
                      > cp: cannot stat 'home/christian/raspi/sysroot/usr/lib/arm-linux-gnueabihf/crt*': No such file or directory
                      > /home/christian/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -Wl,-rpath-link,/home/christian/raspi/sysroot/opt/vc/lib -Wl,-rpath-link,/home/christian/raspi/sysroot/usr/lib/ -Wl,-rpath-link,/home/christian/raspi/sysroot/lib/ -mfloat-abi=hard --sysroot=/home/christian/raspi/sysroot --sysroot=/home/christian/raspi/sysroot -Wl,-O1 -o verifyspec verifyspec.o    
                      > cp: cannot stat 'home/christian/raspi/sysroot/usr/lib/arm-linux-gnueabihf/crt*': No such file or directory
                      > /home/christian/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/4.9.3/../../../../arm-linux-gnueabihf/bin/ld: cannot find crt1.o: No such file or directory
                      > /home/christian/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/4.9.3/../../../../arm-linux-gnueabihf/bin/ld: cannot find crti.o: No such file or directory
                      > /home/christian/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/4.9.3/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lm
                      > collect2: error: ld returned 1 exit status
                      > Makefile:65: recipe for target 'verifyspec' failed
                      > make: *** [verifyspec] Error 1
                      Note: Also available for Linux: linux-clang linux-kcc linux-icc linux-cxx
                      
                      ERROR: Cannot compile a minimal program. The toolchain or QMakeSpec is broken.
                      
                      

                      Got any idea whats wrong?

                      S 1 Reply Last reply 5 Mar 2017, 16:23
                      0
                      • F Fifkie
                        23 Feb 2017, 11:14

                        @hubaiz Looking promising!
                        I just wonder, the second script, is there anything else i need to change than the path to tools and sysroot when targeting qt5.8 and raspberry 3?

                        i changed the paths and ran the script in qtbase but got errors.

                        Running configuration tests...
                        Checking for valid makespec... 
                        + cd /home/christian/raspi/qtbase/config.tests/common/verifyspec && /home/christian/raspi/qtbase/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared console" "QMAKE_CFLAGS += --sysroot=/home/christian/raspi/sysroot" "QMAKE_CXXFLAGS += --sysroot=/home/christian/raspi/sysroot" "QMAKE_LFLAGS += --sysroot=/home/christian/raspi/sysroot" -early "CONFIG += cross_compile" /home/christian/raspi/qtbase/config.tests/common/verifyspec
                        + cd /home/christian/raspi/qtbase/config.tests/common/verifyspec && MAKEFLAGS= /usr/bin/make clean && MAKEFLAGS= /usr/bin/make
                        > rm -f verifyspec.o
                        > rm -f *~ core *.core
                        > /home/christian/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -c -pipe -marm -mfpu=vfp -mtune=arm1176jzf-s -march=armv6zk -mabi=aapcs-linux -mfloat-abi=hard --sysroot=/home/christian/raspi/sysroot --sysroot=/home/christian/raspi/sysroot -O2 -std=gnu++11 -Wall -W -fPIC  -I. -I/home/christian/raspi/qtbase/mkspecs/devices/linux-rasp-pi-g++ -o verifyspec.o verifyspec.cpp
                        > cp: cannot stat 'home/christian/raspi/sysroot/usr/lib/arm-linux-gnueabihf/crt*': No such file or directory
                        > /home/christian/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -Wl,-rpath-link,/home/christian/raspi/sysroot/opt/vc/lib -Wl,-rpath-link,/home/christian/raspi/sysroot/usr/lib/ -Wl,-rpath-link,/home/christian/raspi/sysroot/lib/ -mfloat-abi=hard --sysroot=/home/christian/raspi/sysroot --sysroot=/home/christian/raspi/sysroot -Wl,-O1 -o verifyspec verifyspec.o    
                        > cp: cannot stat 'home/christian/raspi/sysroot/usr/lib/arm-linux-gnueabihf/crt*': No such file or directory
                        > /home/christian/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/4.9.3/../../../../arm-linux-gnueabihf/bin/ld: cannot find crt1.o: No such file or directory
                        > /home/christian/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/4.9.3/../../../../arm-linux-gnueabihf/bin/ld: cannot find crti.o: No such file or directory
                        > /home/christian/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/4.9.3/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lm
                        > collect2: error: ld returned 1 exit status
                        > Makefile:65: recipe for target 'verifyspec' failed
                        > make: *** [verifyspec] Error 1
                        Note: Also available for Linux: linux-clang linux-kcc linux-icc linux-cxx
                        
                        ERROR: Cannot compile a minimal program. The toolchain or QMakeSpec is broken.
                        
                        

                        Got any idea whats wrong?

                        S Offline
                        S Offline
                        shymaxtic
                        wrote on 5 Mar 2017, 16:23 last edited by
                        #13

                        @Fifkie Have you fix this error?

                        1 Reply Last reply
                        0
                        • S Offline
                          S Offline
                          StoatPatronus
                          wrote on 8 Mar 2017, 21:44 last edited by
                          #14

                          I ran into this a few weeks ago when upgrading from Qt 5.7 to 5.8 and following the wiki's instructions. I added -skip qtwebengine -no-icu when I ran ./configure because I don't need those features in my app and it worked fine after that.

                          F 1 Reply Last reply 10 Mar 2017, 11:28
                          0
                          • S StoatPatronus
                            8 Mar 2017, 21:44

                            I ran into this a few weeks ago when upgrading from Qt 5.7 to 5.8 and following the wiki's instructions. I added -skip qtwebengine -no-icu when I ran ./configure because I don't need those features in my app and it worked fine after that.

                            F Offline
                            F Offline
                            Fifkie
                            wrote on 10 Mar 2017, 11:28 last edited by
                            #15

                            @StoatPatronus Did you put it in the script? I get an error when i try to run it:

                            ERROR: Unknown command line option '-skip'.
                            

                            Have tried to put in the beginning and in the end of the script, but i guess as long it doesn't know what it is that does not matter.

                            J 1 Reply Last reply 10 Mar 2017, 12:34
                            0
                            • F Fifkie
                              10 Mar 2017, 11:28

                              @StoatPatronus Did you put it in the script? I get an error when i try to run it:

                              ERROR: Unknown command line option '-skip'.
                              

                              Have tried to put in the beginning and in the end of the script, but i guess as long it doesn't know what it is that does not matter.

                              J Offline
                              J Offline
                              jsulm
                              Lifetime Qt Champion
                              wrote on 10 Mar 2017, 12:34 last edited by
                              #16

                              @Fifkie Can you show your script?

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

                              F 1 Reply Last reply 10 Mar 2017, 14:02
                              0
                              • J jsulm
                                10 Mar 2017, 12:34

                                @Fifkie Can you show your script?

                                F Offline
                                F Offline
                                Fifkie
                                wrote on 10 Mar 2017, 14:02 last edited by
                                #17

                                @jsulm Sure!

                                It's this script:

                                #!/bin/sh
                                ./configure -opengl es2 -device linux-rasp-pi-g++ -device-option CROSS_COMPILE=/home/marco/Qt/5.3/tools-master/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf- -sysroot /home/marco/Qt/5.3/sysroot -opensource -confirm-license -optimized-qmake -reduce-exports -release -make libs -prefix /usr/local/qt5pi -hostprefix /usr/local/qt5pi -v
                                

                                With the "-skip qtwebengine -no-icu" added. I've tried right in the beginning after ./configure, in the end and after "-opensource". Neither worked.

                                S 1 Reply Last reply 13 Mar 2017, 18:54
                                0
                                • 8 Offline
                                  8 Offline
                                  805Badger
                                  wrote on 10 Mar 2017, 19:20 last edited by
                                  #18

                                  @Fifkie

                                  I was having the same issue and reconfigured with just the -no-icu flag and everything worked fine (I use qtwebengine in my app) my config string is as follows...

                                  ./configure -release -opengl es2 -device linux-rasp-pi2-g++ -device-option CROSS_COMPILE=~/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf- -sysroot ~/raspi/sysroot -opensource -confirm-license -prefix /usr/local/qt5pi -extprefix ~/raspi/qt5pi -no-icu -hostprefix ~/raspi/qt5 -v

                                  1 Reply Last reply
                                  0
                                  • F Fifkie
                                    10 Mar 2017, 14:02

                                    @jsulm Sure!

                                    It's this script:

                                    #!/bin/sh
                                    ./configure -opengl es2 -device linux-rasp-pi-g++ -device-option CROSS_COMPILE=/home/marco/Qt/5.3/tools-master/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf- -sysroot /home/marco/Qt/5.3/sysroot -opensource -confirm-license -optimized-qmake -reduce-exports -release -make libs -prefix /usr/local/qt5pi -hostprefix /usr/local/qt5pi -v
                                    

                                    With the "-skip qtwebengine -no-icu" added. I've tried right in the beginning after ./configure, in the end and after "-opensource". Neither worked.

                                    S Offline
                                    S Offline
                                    StoatPatronus
                                    wrote on 13 Mar 2017, 18:54 last edited by
                                    #19

                                    @Fifkie Here's my command line, please replace the {{ stuff in brackets }} with the paths for your system:

                                    ./configure -release -opengl es2 -device linux-rasp-pi2-g++ -device-option CROSS_COMPILE={{pi_folder}}/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf- -sysroot {{pi_folder}}/sysroot -opensource -confirm-license -skip qtwebengine -no-icu -make libs -prefix /usr/local/qt5pi -extprefix {{pi_folder}}/qt5pi -hostprefix {{pi_folder}}/qt5

                                    One thing I noticed in the config string you posted is it looks like Qt 5.3 (/home/marco/Qt/5.3/...etc) which I haven't tried - I only tried with 5.8.

                                    F 1 Reply Last reply 13 Mar 2017, 19:26
                                    0
                                    • S StoatPatronus
                                      13 Mar 2017, 18:54

                                      @Fifkie Here's my command line, please replace the {{ stuff in brackets }} with the paths for your system:

                                      ./configure -release -opengl es2 -device linux-rasp-pi2-g++ -device-option CROSS_COMPILE={{pi_folder}}/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf- -sysroot {{pi_folder}}/sysroot -opensource -confirm-license -skip qtwebengine -no-icu -make libs -prefix /usr/local/qt5pi -extprefix {{pi_folder}}/qt5pi -hostprefix {{pi_folder}}/qt5

                                      One thing I noticed in the config string you posted is it looks like Qt 5.3 (/home/marco/Qt/5.3/...etc) which I haven't tried - I only tried with 5.8.

                                      F Offline
                                      F Offline
                                      Fifkie
                                      wrote on 13 Mar 2017, 19:26 last edited by
                                      #20

                                      @StoatPatronus Now as i review the script i posted, i must have just copied that from the tut, not from the script i use because there are several things not matching. But I got Kukkimonsuta's tutorial working for me so i got it working now. For anyone else looking for a solution just follow the steps at https://github.com/Kukkimonsuta/rpi-buildqt . Only thing i had to change was with one of the scripts i got an error that it didn't have the permission to sync one folder from the RPI. So in the sync script i just added

                                      --exclude 'vnc'
                                      

                                      in the rsync under "== Copy /usr/lib =="
                                      That's because it wouldn't sync the vnc-folder.

                                      S 2 Replies Last reply 15 Mar 2017, 18:30
                                      0
                                      • F Fifkie
                                        13 Mar 2017, 19:26

                                        @StoatPatronus Now as i review the script i posted, i must have just copied that from the tut, not from the script i use because there are several things not matching. But I got Kukkimonsuta's tutorial working for me so i got it working now. For anyone else looking for a solution just follow the steps at https://github.com/Kukkimonsuta/rpi-buildqt . Only thing i had to change was with one of the scripts i got an error that it didn't have the permission to sync one folder from the RPI. So in the sync script i just added

                                        --exclude 'vnc'
                                        

                                        in the rsync under "== Copy /usr/lib =="
                                        That's because it wouldn't sync the vnc-folder.

                                        S Offline
                                        S Offline
                                        StoatPatronus
                                        wrote on 15 Mar 2017, 18:30 last edited by
                                        #21

                                        @Fifkie I'm glad you got it working. Kukkimonsuta's guide is very helpful. For my project I wrote a couple Ansible playbooks to automate the process, so it's easy to upgrade to new versions of Qt in the future. Unfortunately I can't share them at this point, but I may later if I clean them up.

                                        1 Reply Last reply
                                        0
                                        • F Fifkie
                                          13 Mar 2017, 19:26

                                          @StoatPatronus Now as i review the script i posted, i must have just copied that from the tut, not from the script i use because there are several things not matching. But I got Kukkimonsuta's tutorial working for me so i got it working now. For anyone else looking for a solution just follow the steps at https://github.com/Kukkimonsuta/rpi-buildqt . Only thing i had to change was with one of the scripts i got an error that it didn't have the permission to sync one folder from the RPI. So in the sync script i just added

                                          --exclude 'vnc'
                                          

                                          in the rsync under "== Copy /usr/lib =="
                                          That's because it wouldn't sync the vnc-folder.

                                          S Offline
                                          S Offline
                                          StoatPatronus
                                          wrote on 21 Mar 2017, 17:58 last edited by
                                          #22

                                          I cleaned up my ansible playbooks and posted them at https://bitbucket.org/johnwoltman/build_qt_for_pi_with_ansible

                                          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