Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. QtonPi
  4. Qt4 on Raspberry Pi
Forum Updated to NodeBB v4.3 + New Features

Qt4 on Raspberry Pi

Scheduled Pinned Locked Moved QtonPi
11 Posts 5 Posters 14.3k Views 1 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.
  • E Offline
    E Offline
    euxon
    wrote on last edited by
    #1

    Hey Qt community!

    I have made a program for my Raspberry Pi, wheezy distro, in Qt Creator 4.7.4 but I can't figure out how to compile it to work with the Pi. I have been searching but everything I get is for Qt5. Is it even possible to compile for Raspberry with Qt4, or do I have to transit to Qt5 - and if so, how do I do it?

    Thanks a lot!

    Best regards
    Rasmus

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mlong
      wrote on last edited by
      #2

      As far as I know, all active Raspberry Pi development is using Qt 5.

      Software Engineer
      My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

      1 Reply Last reply
      0
      • E Offline
        E Offline
        euxon
        wrote on last edited by
        #3

        Thank you for your answer!

        So I have to transit to Qt 5. I would rather not but it might be the only solution.

        Should I just download the latest beta from http://releases.qt-project.org/qt5.0/beta1/ and install it? Is there anything I should be aware of when going from Qt 4 to Qt 5?

        1 Reply Last reply
        0
        • C Offline
          C Offline
          codenode
          wrote on last edited by
          #4

          hm, dunno. As Raspian is based on debian, you probably could get qt 4.7/8 to compile your program.
          Still, the support for hardware on this platform is a Qt5 issue indeed.

          1 Reply Last reply
          0
          • L Offline
            L Offline
            luca
            wrote on last edited by
            #5

            Hi all,
            I'm trying to build qt4 for my raspberry pi without success.

            I got the toolchain with this:
            @
            git clone https://github.com/raspberrypi/tools.git --depth 1
            @

            then I edited qt-everywhere-opensource-src-4.8.3/mkspecs/qws/linux-arm-g++/qmake.conf :
            @

            include(../../common/gcc-base-unix.conf)
            include(../../common/g++-unix.conf)
            include(../../common/linux.conf)
            include(../../common/qws.conf)

            QMAKE_CC = /tools/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi/bin/arm-bcm2708hardfp-linux-gnueabi-gcc
            QMAKE_CXX = /tools/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi/bin/arm-bcm2708hardfp-linux-gnueabi-g++
            QMAKE_LINK = /tools/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi/bin/arm-bcm2708hardfp-linux-gnueabi-g++
            QMAKE_LINK_SHLIB = /tools/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi/bin/arm-bcm2708hardfp-linux-gnueabi-g++

            QMAKE_AR = /tools/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi/bin/arm-bcm2708hardfp-linux-gnueabi-ar cqs
            QMAKE_OBJCOPY = /tools/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi/bin/arm-bcm2708hardfp-linux-gnueabi-objcopy
            QMAKE_RANLIB = /tools/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi/bin/arm-bcm2708hardfp-linux-gnueabi-ranlib

            load(qt_config)

            @

            and built qt with this:
            @
            ./configure -opensource -confirm-license -no-qt3support -release -nomake examples -nomake demos -embedded arm -little-endian -prefix /opt/qt4-4.8.3-slackrasp -qt-gfx-vnc -no-phonon -no-webkit -no-script -no-declarative -no-javascript-jit -no-pch
            make
            make install
            @

            it build without errors but the library seems to be incompatible with Raspberry PI :
            @
            luca@slackrasp:~$ ldd /opt/qt4-4.8.3-slackrasp/lib/libQtCore.so
            not a dynamic executable
            @

            where is the problem...?

            1 Reply Last reply
            0
            • EddyE Offline
              EddyE Offline
              Eddy
              wrote on last edited by
              #6

              have a look at this "wiki page":http://qt-project.org/wiki/RaspberryPi

              At the end there is a part about Qt4, with a link to the necessary specs.

              Hope this helps.

              Qt Certified Specialist
              www.edalsolutions.be

              1 Reply Last reply
              0
              • L Offline
                L Offline
                luca
                wrote on last edited by
                #7

                Thanks for the link.
                I tried to follow the described procedure without success.

                I'm using the wheezy image from "raspberry download page":http://www.raspberrypi.org/downloads .
                As toolchain I used the packages from wiki page "gcc-4.7-linaro-rpi-gnueabihf.tbz":http://blueocean.qmh-project.org/gcc-4.7-linaro-rpi-gnueabihf.tbz and extracted in /gcc-4.7-linaro-rpi-gnueabihf/ .
                I also copied the folder I found in "https://gitorious.org/qt-platform-mkspecs/qt-platform-mkspecs/trees/master/4.8/qws/linux-rasp-pi-g++ ":https://gitorious.org/qt-platform-mkspecs/qt-platform-mkspecs/trees/master/4.8/qws/linux-rasp-pi-g++ in my qt source folder in mkspecs/qws/ .
                I mounted my raspberry rootfs in /mnt/tmp .

                To configure Qt I tried both the following:
                @
                ./configure -opensource -confirm-license -no-qt3support -release -nomake examples -nomake demos -embedded rasp-pi -little-endian -prefix /opt/qt4-4.8.3-slackrasp -qt-gfx-vnc
                @
                @
                ./configure -opensource -confirm-license -sysroot /mnt/tmp/ -no-qt3support -release -nomake examples -nomake demos -embedded rasp-pi -little-endian -prefix /opt/qt4-4.8.3-slackrasp -qt-gfx-vnc
                @
                The second ones doesn't compile, I get some libraries errors.
                @
                obj/release-shared-emb-rasp-pi/qlibrary_unix.o: In function QLibraryPrivate::load_sys()': qlibrary_unix.cpp:(.text+0xb10): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /mnt/tmp/usr/lib/arm-linux-gnueabihf/libdl.a(dlopen.o): In function dlopen':
                (.text+0xc): undefined reference to __dlopen' /mnt/tmp/usr/lib/arm-linux-gnueabihf/libdl.a(dlclose.o): In function dlclose':
                (.text+0x0): undefined reference to __dlclose' /mnt/tmp/usr/lib/arm-linux-gnueabihf/libdl.a(dlsym.o): In function dlsym':
                (.text+0xc): undefined reference to __dlsym' /mnt/tmp/usr/lib/arm-linux-gnueabihf/libdl.a(dlerror.o): In function dlerror':
                (.text+0x0): undefined reference to __dlerror' /mnt/tmp/usr/lib/arm-linux-gnueabihf/libm.a(feholdexcpt.o): In function feholdexcept':
                (.text+0x48): undefined reference to _dl_hwcap' /mnt/tmp/usr/lib/arm-linux-gnueabihf/libm.a(fesetenv.o): In function fesetenv':
                (.text+0x64): undefined reference to _dl_hwcap' collect2: error: ld returned 1 exit status gmake[1]: *** [../../lib/libQtCore.so.4.8.3] Error 1 gmake[1]: Leaving directory /mnt/temporanea/luca/qt-everywhere-opensource-src-4.8.3/src/corelib'
                gmake: *** [sub-corelib-make_default-ordered] Error 2
                @

                The first compile without problem so I can put the libraries to my board but when I cross-compile some applications for the board and I try to execute on the board I get:
                @
                Illegal instruction
                @

                where do I wrong...?

                1 Reply Last reply
                0
                • L Offline
                  L Offline
                  luca
                  wrote on last edited by
                  #8

                  I think there are too much tutorial saying different things to build Qt for Raspberry Pi so it's quite impossible to know what is the right one.

                  Building for BeagleBoard was very easier than building for Raspberry...

                  1 Reply Last reply
                  0
                  • EddyE Offline
                    EddyE Offline
                    Eddy
                    wrote on last edited by
                    #9

                    Hi Luca,

                    There is a simple solution to install Qt4 on the Pi : just apt-get it.

                    Have a look at the "tutorial ":http://qt-project.org/wiki/apt-get_Qt4_on_the_Raspberry_Pi I made. I hope lots of people that want to start programming discover Qt this way. Isn’t that the goal of the Raspberry Pi after all?

                    BTW : congrats on installing Qt5. That will be one of my next ramblings...

                    Qt Certified Specialist
                    www.edalsolutions.be

                    1 Reply Last reply
                    0
                    • L Offline
                      L Offline
                      luca
                      wrote on last edited by
                      #10

                      Hi Eddy,
                      unfortunately the tutorial you posted doesn't provide a working cross-toolchain (it seems...) .
                      It describe how to get a working Qt installation in the board but this way I must build my app using RaspberryPi.

                      As I wrote in "this post":https://qt-project.org/forums/viewthread/22733/ I successfully get a working Qt5 with cross-toolchain form the Raspberry . It was not so difficult. Unfortunately for you it's in italian but if you need I can describe you what I've done.

                      1 Reply Last reply
                      0
                      • EddyE Offline
                        EddyE Offline
                        Eddy
                        wrote on last edited by
                        #11

                        bq. unfortunately the tutorial you posted doesn’t provide a working cross-toolchain (it seems…) .
                        Yes you are right. I didn't have the intention to use the Pi for cross compiling. I prefer to use my PC for that. ;-)

                        thanks for the offer. I will try it first using a translator.

                        Qt Certified Specialist
                        www.edalsolutions.be

                        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