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. qt 5.10.1 cross compile for raspberry pi 3 in debian stretch
Forum Updated to NodeBB v4.3 + New Features

qt 5.10.1 cross compile for raspberry pi 3 in debian stretch

Scheduled Pinned Locked Moved Unsolved General and Desktop
22 Posts 5 Posters 9.1k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sdttn
    wrote on last edited by
    #8

    @sierdzio said in qt 5.10.1 cross compile for raspberry pi 3 in debian stretch:

    Make sure you properly rsync'ed your sysroot from your raspbery pi, then run the symlink fix script again. I'm pretty certain that's the issue.

    Have you used the qtbase or from the source file qt-everywhere-opensource-src-5.7.0.tar.gz.
    I have tried again and still getting the same errors. May be I should try Qt 5.10.0 instead of Qt 5.10.1.

    Kind regards,

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #9

      I've used qt-everywhere-src-5.10.1.tar.xz for the test above. I have also successfully compiled 5.10.0 and 5.9.4 with the same sysroot and toolchain.

      (Z(:^

      1 Reply Last reply
      1
      • S Offline
        S Offline
        sdttn
        wrote on last edited by
        #10

        OK. This is really weird. What am I missing. I have done everything.... including fixing the sysroot folder. Because I just tried even with the 5.10.0 still didnt work.

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #11

          Dunno. I'm on Ubuntu and not Debian Stretch, but I doubt this is of any relevance here.

          Perhaps it's about some detail on the wiki, I was not following it word for word (mostly because I'm setting up prefixes and folders differently - but the toolchain+sysroot is the same. Plus additionally, I'm running on a live Pi and not the OS image).

          I did have exactly the issue you had, and in my case running the symlink fix did the trick. One idea - check the version of your symlink script, perhaps some new commit spoiled it or something. Mine is from ~11 January 2018. Actually, let me send it to you, here you go: https://www.dropbox.com/s/1alp65bf2lenrjj/sysroot-relativelinks-1.10-priv.py?dl=0

          (Z(:^

          S 1 Reply Last reply
          1
          • sierdzioS sierdzio

            Dunno. I'm on Ubuntu and not Debian Stretch, but I doubt this is of any relevance here.

            Perhaps it's about some detail on the wiki, I was not following it word for word (mostly because I'm setting up prefixes and folders differently - but the toolchain+sysroot is the same. Plus additionally, I'm running on a live Pi and not the OS image).

            I did have exactly the issue you had, and in my case running the symlink fix did the trick. One idea - check the version of your symlink script, perhaps some new commit spoiled it or something. Mine is from ~11 January 2018. Actually, let me send it to you, here you go: https://www.dropbox.com/s/1alp65bf2lenrjj/sysroot-relativelinks-1.10-priv.py?dl=0

            S Offline
            S Offline
            sdttn
            wrote on last edited by
            #12

            @sierdzio said in qt 5.10.1 cross compile for raspberry pi 3 in debian stretch:

            I did have exactly the issue you had, and in my case running the symlink fix did the trick

            Thank @sierdzio I ll try with your file along with couple of other things and I ll put the results here. But I am glad you get the same error too, I have started to think that I am crazy :)

            I am not sure what version of raspberry pi is installed on the machine though, I havent put fresh OS in RPI3. There was already some OS in it. That might be an issue. The second possibility could be the OS on my desktop side (debian stretch).
            These are the possibilities that I can come up with just right now.

            Like I said I will try and let you know.
            Thank you for your kind responses.

            Regards,

            1 Reply Last reply
            1
            • S Offline
              S Offline
              sdttn
              wrote on last edited by sdttn
              #13

              hi @sierdzio once again,

              I have tried the file from the link you have given but this time I got the error as below.

              g++: error trying to exec 'cc1plus': execvp: No such file or directory
              Makefile:242: recipe for target 'main.o' failed
              make: *** [main.o] Error 1
              
              

              This time I have tried for both 5.10.0 and 5.10.1 still on debian stretch installed on virtual machine.
              Thanks,

              1 Reply Last reply
              0
              • sierdzioS Offline
                sierdzioS Offline
                sierdzio
                Moderators
                wrote on last edited by
                #14

                This one I've not met before.

                (Z(:^

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #15

                  Hi,

                  Might be a silly question but do you have g++ installed ?

                  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
                  • S Offline
                    S Offline
                    sdttn
                    wrote on last edited by sdttn
                    #16

                    Hi @SGaist,

                    which g++ are you talking about? You mean this
                    apt-get install g++
                    Then yes. Interestingly something happened, I was trying for 5.9.4 and it didint even configure with ./config
                    Now it keeps giving me the error

                    g++: error trying to exec 'cc1plus': execvp: No such file or directory
                    Makefile:242: recipe for target 'main.o' failed
                    make: *** [main.o] Error 1
                    

                    Right before that I was getting pcre_compile.o failed kind of error.

                    This is really getting messy. Not sure what to do at this point though.

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #17

                      I’d start by verifying that you can use g++ for a simple hello world application.

                      I’d also double check the installation of the development tools.

                      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
                      • S Offline
                        S Offline
                        sdttn
                        wrote on last edited by
                        #18

                        Hi again,

                        After I am able to compile, I was trying to make an example code which is a simple push button changes the text and I have gotten the error below.
                        By the way instead of using linaro gcc and g++, I used the one that I have installed with the command

                        apt-get install gcc-arm-linux-gnueabihf
                        apt-get install g++-arm-linux-gnueabihf
                        

                        I am not sure what the problem is though. Do you think that at some point my compilers and debuggers got mixed up.? Thats my best guess though. I am open for any ideas.

                        /usr/bin/arm-linux-gnueabihf-g++ -mfloat-abi=hard --sysroot=/root/raspi/sysroot -Wl,-rpath,/usr/local/qt5pi/lib -Wl,-rpath-link,/root/raspi/sysroot/opt/vc/lib -Wl,-rpath-link,/root/raspi/sysroot/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link,/root/raspi/sysroot/lib/arm-linux-gnueabihf -o testRPI3 main.o mainwindow.o moc_mainwindow.o   -L=/opt/vc/lib -L/root/raspi/qt5pi/lib -lQt5Widgets -lQt5Gui -lQt5Core -L/root/raspi/sysroot/usr/lib/arm-linux-gnueabihf -lGLESv2 -lpthread 
                        main.o: file not recognized: File format not recognized
                        collect2: error: ld returned 1 exit status
                        Makefile:245: recipe for target 'testRPI3' failed
                        make: *** [testRPI3] Error 1
                        05:40:53: The process "/usr/bin/make" exited with code 2.
                        Error while building/deploying project testRPI3 (kit: Raspberry Pi 3 )
                        When executing step "Make"
                        05:40:53: Elapsed time: 00:00.
                        

                        Kind regards,

                        jsulmJ 1 Reply Last reply
                        0
                        • S sdttn

                          Hi again,

                          After I am able to compile, I was trying to make an example code which is a simple push button changes the text and I have gotten the error below.
                          By the way instead of using linaro gcc and g++, I used the one that I have installed with the command

                          apt-get install gcc-arm-linux-gnueabihf
                          apt-get install g++-arm-linux-gnueabihf
                          

                          I am not sure what the problem is though. Do you think that at some point my compilers and debuggers got mixed up.? Thats my best guess though. I am open for any ideas.

                          /usr/bin/arm-linux-gnueabihf-g++ -mfloat-abi=hard --sysroot=/root/raspi/sysroot -Wl,-rpath,/usr/local/qt5pi/lib -Wl,-rpath-link,/root/raspi/sysroot/opt/vc/lib -Wl,-rpath-link,/root/raspi/sysroot/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link,/root/raspi/sysroot/lib/arm-linux-gnueabihf -o testRPI3 main.o mainwindow.o moc_mainwindow.o   -L=/opt/vc/lib -L/root/raspi/qt5pi/lib -lQt5Widgets -lQt5Gui -lQt5Core -L/root/raspi/sysroot/usr/lib/arm-linux-gnueabihf -lGLESv2 -lpthread 
                          main.o: file not recognized: File format not recognized
                          collect2: error: ld returned 1 exit status
                          Makefile:245: recipe for target 'testRPI3' failed
                          make: *** [testRPI3] Error 1
                          05:40:53: The process "/usr/bin/make" exited with code 2.
                          Error while building/deploying project testRPI3 (kit: Raspberry Pi 3 )
                          When executing step "Make"
                          05:40:53: Elapsed time: 00:00.
                          

                          Kind regards,

                          jsulmJ Offline
                          jsulmJ Offline
                          jsulm
                          Lifetime Qt Champion
                          wrote on last edited by
                          #19

                          @sdttn Looks like you compiled all the *.o files with a different compiler. You should clean up and rebuild.

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

                          1 Reply Last reply
                          1
                          • S Offline
                            S Offline
                            sdttn
                            wrote on last edited by sdttn
                            #20

                            @sdttn said in qt 5.10.1 cross compile for raspberry pi 3 in debian stretch:

                            apt-get install gcc-arm-linux-gnueabihf
                            apt-get install g++-arm-linux-gnueabihf

                            Can I use these three including gdb as well. Are these correct tools? or Should I use the linaro one...

                            apt-get install gcc-arm-linux-gnueabihf
                            apt-get install g++-arm-linux-gnueabihf
                            apt-get install gdb-multiarch
                            
                            jsulmJ 1 Reply Last reply
                            0
                            • S sdttn

                              @sdttn said in qt 5.10.1 cross compile for raspberry pi 3 in debian stretch:

                              apt-get install gcc-arm-linux-gnueabihf
                              apt-get install g++-arm-linux-gnueabihf

                              Can I use these three including gdb as well. Are these correct tools? or Should I use the linaro one...

                              apt-get install gcc-arm-linux-gnueabihf
                              apt-get install g++-arm-linux-gnueabihf
                              apt-get install gdb-multiarch
                              
                              jsulmJ Offline
                              jsulmJ Offline
                              jsulm
                              Lifetime Qt Champion
                              wrote on last edited by
                              #21

                              @sdttn You should not mix binaries built with different compilers. Either you build everything with gcc-arm-linux-gnueabihf or you build everything with the Linaro toolchain. That's why I suggested to cleanup and rebuild: to get rid of all *.o files and build everything with same compiler.

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

                              1 Reply Last reply
                              1
                              • S sdttn

                                Hi everyone,

                                I have been trying to qt cross compile (qt 5.10.1) for raspberry pi 3 in debian stretch. I am strictly following the links here and here. During (after make command) compilation I am getting the error below.

                                In file included from ../../include/QtCore/qglobal.h:1:0,
                                                 from ../corelib/global/qt_pch.h:56:
                                ../../include/QtCore/../../src/corelib/global/qglobal.h:762:47: error: static assertion failed: Required feature library for file ../../include/QtCore/../../src/corelib/plugin/qlibrary.h not available.
                                 #define Q_STATIC_ASSERT_X(Condition, Message) static_assert(bool(Condition), Message)
                                                                               ^
                                ../../include/QtCore/../../src/corelib/global/qglobal.h:86:36: note: in expansion of macro ‘Q_STATIC_ASSERT_X’
                                 #define QT_REQUIRE_CONFIG(feature) Q_STATIC_ASSERT_X(QT_FEATURE_##feature == 1, "Required feature " #feature " for file " __FILE__ " not available.")
                                                                    ^
                                ../../include/QtCore/../../src/corelib/plugin/qlibrary.h:45:1: note: in expansion of macro ‘QT_REQUIRE_CONFIG’
                                 QT_REQUIRE_CONFIG(library);
                                 ^
                                Makefile:27975: recipe for target '.obj/qsslsocket_opensslpre11.o' failed
                                make[2]: *** [.obj/qsslsocket_opensslpre11.o] Error 1
                                make[2]: Leaving directory '/root/raspi/qtbase/src/network'
                                Makefile:273: recipe for target 'sub-network-make_first' failed
                                make[1]: *** [sub-network-make_first] Error 2
                                make[1]: Leaving directory '/root/raspi/qtbase/src'
                                Makefile:48: recipe for target 'sub-src-make_first' failed
                                make: *** [sub-src-make_first] Error 2
                                

                                My best guess was that there is something wrong about the libraries of Qt, but I am not sure of course.
                                I am looking forward to hearing your solution ideas to this problem.

                                Thanks in advance.

                                sdttn,

                                L Offline
                                L Offline
                                lirik90
                                wrote on last edited by lirik90
                                #22

                                @sdttn Hi! I had the same issue. And the problem was that Qt couldn't find libdl.so To fix this I put libdl.so in /sysroot/usr/lib.

                                To find it i add -feature-library flag to ./configure. That command what i use:

                                ./configure -release -opengl es2 -device linux-rasp-pi3-g++ -device-option CROSS_COMPILE=armv8-rpi3-linux-gnueabihf- -sysroot /mnt/second/proj/dai/env/work/sysroot -opensource -confirm-license -make libs -nomake examples -nomake tests -prefix /usr/local/qt5pi -extprefix /mnt/second/proj/dai/env/work/qt5pi -hostprefix /mnt/second/proj/dai/env/work/qt5 -v -no-use-gold-linker -sql-mysql -mysql_config /mnt/second/proj/dai/env/work/../mysql_config -ssl -openssl-runtime -feature-library
                                
                                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