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-compilation on PC/UBUNTU for target PANDABOARD/UBUNTU.
Forum Updated to NodeBB v4.3 + New Features

Cross-compilation on PC/UBUNTU for target PANDABOARD/UBUNTU.

Scheduled Pinned Locked Moved Mobile and Embedded
18 Posts 2 Posters 8.5k 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.
  • R Offline
    R Offline
    reme
    wrote on last edited by
    #1

    Hello,

    I discover this forum during the building of my first Qt application. It is the first time I use it.
    I cross compile a Qt project on a PC/UBUNTU for the target : PANDABOARD/UBUNTU.
    I obtain a binary and run it on the PANDABOARD.
    I obtain the following message :
    "Could not find the Qt platform xcb"
    After reading some articles in qt-project.org, I understand I need to generate the dynamic library libxcb.so.1 on my PC/UBUNTU for the PANDABOARD/UBUNTU.
    Please, could you help me to cross compile this library on my PC/UBUNTU ?

    Best regards.

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

      Hi and welcome to devnet,

      Since your PandaBoard runs ubuntu, why not use the package manager from it to install the missing libraries ?

      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
      • R Offline
        R Offline
        reme
        wrote on last edited by
        #3

        Hi

        Thanks for your answer.

        I specify the complete message after running :

        This application failed to start because it could not find or load the Qt platform plugin "xcb".Reinstalling the application may fix this problem. Aborted (core dumped)

        I think the xcb package is already present on my target PANDABOARD/UBUNTU.
        Indeed, the result of the command

        sudo apt-cache pkgnames | grep xcb is :
        libxcb-doc

        libxcb-image0

        libxcb-sync0

        libxcb-render-util0

        libxcb-dpms0

        libxcb-glx0-dbg

        libxcb-glx0-dev

        libxcb-xprint0

        libxcb-icccm4-dev

        libxcb-xinerama0-dbg

        libxcb-keysyms1

        libxcb-xinerama0-dev

        libxcb-xevie0-dbg

        libxcb-shm0-dbg

        libxcb-icccm4

        libxcb-composite0-dbg

        libxcb-xevie0-dev

        libxcb-shm0-dev

        libxcb-composite0-dev

        libxcb-dri2-0-dbg

        libxcb-dri2-0-dev

        libxcb-xv0

        libxcb-screensaver0-dbg

        libxcb-glx0

        libxcb-screensaver0-dev

        libxcb-xevie0

        libxcb-xfixes0

        libxcb-sync0-dbg

        python-xcbgen

        libxcb-sync0-dev

        libx11-xcb1

        libxcb-util0

        libxcb-keysyms1-dev

        libxcb-xvmc0

        libxcb-render0

        libxcb-damage0-dbg

        libxcb-damage0-dev

        libxcb-res0-dbg

        libxcb-res0-dev

        libxcb1

        libxcb-shape0-dbg

        libxcb-shape0-dev

        libx11-xcb-dev

        libxcb-render-util0-dev

        libxcb-damage0

        libxcb-shape0

        xcb-proto

        libxcb-randr0-dbg

        libxcb-randr0-dev

        libxcb-xinerama0

        libx11-xcb1-dbg

        libxcb-randr0

        libxcb-composite0

        libxcb-xv0-dbg

        libxcb-xv0-dev

        xcb

        libxcb-dpms0-dbg

        libxcb-dpms0-dev

        libxcb-ewmh1

        libxcb-dri2-0

        libxcb-xf86dri0-dbg

        libxcb-xf86dri0-dev

        libxcb-xf86dri0

        libxcb-res0

        libxcb-util0-dev

        libxcb-xfixes0-dbg

        libxcb-render0-dbg

        libxcb-xfixes0-dev

        libxcb-record0-dbg

        libxcb-render0-dev

        libxcb-record0

        libxcb-xvmc0-dbg

        libxcb-record0-dev

        libxcb1-dbg

        libxcb-xvmc0-dev

        libxcb1-dev

        libxcb-shm0

        libxcb-xtest0

        libxcb-xtest0-dbg

        libxcb-xtest0-dev

        libxcb-image0-dev

        libxcb-ewmh1-dev

        libxcb-screensaver0

        libxcb-xprint0-dbg

        libxcb-xprint0-dev

        Best regards.

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

          Did you also installed the Qt dlls along with your application ?

          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
          • R Offline
            R Offline
            reme
            wrote on last edited by
            #5

            No because my target is PANDABOARD / UBUNTU.
            After reading the deployment documentation it seems I need to compile the pluggin "xcb" :

            but I am not able to produce the xcb dynamic library.

            In the following directory :
            qt-everywhere-opensource-src-5.2.1/qtbase/src/plugins/platforms/xcb

            cd ../xcbplugins
            make clean
            qmake -config release
            make

            Do you agree with this approach ?

            Thanks and best regards.

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

              Before compiling anything, did you also deploy the Qt 5 plugins ?

              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
              • R Offline
                R Offline
                reme
                wrote on last edited by
                #7

                Yes I deployed Qt 5 plugins (qtbase/plugins/platforms) on my target in the directory ./platforms.
                But I think the xcb pluggin is lacked.
                By running my application with gdb on my target I obtained the following message:

                This application failed to start because it could not find or load the Qt platform plugin “xcb”.
                Available platform pluggins are: linuxfb(from ./platforms), minimal (from ./platforms), offsreen (from ./platforms).

                The error message is produced by QGuiApplicationPrivate::createPlatformIntegration() function

                So, I think there is a problem because the xcb platform is not present in
                qtbase/plugins/platforms.

                Do you agree ?

                Thanks.

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

                  If it wasn't already built, it means that the test for it failed.

                  Do a new configure and force the use of xcb, you'll probably see it failed stating that the needed libraries/headers where not found. If it's the case, you are missing the necessary dev packages for it

                  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
                  • R Offline
                    R Offline
                    reme
                    wrote on last edited by
                    #9

                    Hi,

                    Indeed there are problems during the new configure with -xcb.
                    I read src/plugins/platforms/xcb/README and install all the dependency packages for libxcb.
                    I found all the libraries thanks to the following command :
                    sudo apt-cache pkgnames | grep "libxcb*"

                    So, I do not understand why the last 3 lines of the message :
                    "The test for linking against libxcb failed!
                    You might need to install dependency packages for libxcb.
                    See src/plugins/platforms/xcb/README"

                    The result of the configure command is the following :
                    Sorry for the size of the message but I am not able to specify which piece of information is important.

                    ./configure -xcb -v -prefix /home/stimg/QT/qt-everywhere-opensource-src-5.2.1/qtbase -skip connectivity -qreal float -nomake tests -nomake examples -opensource -xplatform linux-arm-gnueabi-g++

                    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                    BEGIN MESSAGE
                    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

                    DEFAULT_LIBDIRS="/usr/lib/gcc/arm-linux-gnueabihf/4.6
                    /usr/lib/gcc/arm-linux-gnueabihf/lib
                    Creating qmake...
                    make: Nothing to be done for `first'.
                    Running configuration tests...
                    Warning: Disabling pkg-config since PKG_CONFIG_LIBDIR is not set.
                    Warning: Disabling pkg-config since PKG_CONFIG_SYSROOT_DIR is not set.
                    Determining architecture... ()
                    arm-linux-gnueabihf-g++-4.6 -c -pipe -g -Wall -W -fPIE -I../../mkspecs/linux-arm-gnueabi-g++ -I. -o arch.o arch.cpp
                    arm-linux-gnueabihf-g++-4.6 -o arch arch.o
                    /usr/bin/arm-linux-gnueabihf-ld: unrecognised emulation mode: armelf_linux_eabi
                    Supported emulations: elf_x86_64 elf32_x86_64 elf_i386 i386linux elf_l1om elf_k1om
                    collect2: ld returned 1 exit status
                    make: *** [arch] Error 1
                    Unable to determine architecture!

                    Could not determine the target architecture!
                    Turn on verbose messaging (-v) to see the final report.
                    Determining architecture... ()
                    g++ -c -pipe -g -Wall -W -fPIE -I../../mkspecs/linux-g++ -I. -o arch.o arch.cpp
                    g++ -o arch arch.o
                    { test -n "" && DESTDIR="" || DESTDIR=.; } && test $(gdb --version | sed -e 's,[^0-9][^0-9]([0-9]).([0-9]).,\1\2,;q') -gt 72 && gdb --nx --batch --quiet -ex 'set confirm off' -ex "save gdb-index $DESTDIR" -ex quit 'arch' && test -f arch.gdb-index && objcopy --add-section '.gdb_index=arch.gdb-index' --set-section-flags '.gdb_index=readonly' 'arch' 'arch' && rm -f arch.gdb-index || true
                    Found architecture in binary
                    CFG_HOST_ARCH="x86_64"
                    CFG_HOST_CPUFEATURES=" mmx sse sse2"
                    System architecture: 'unknown'
                    Host architecture: 'x86_64'
                    C++11 auto-detection... ()
                    arm-linux-gnueabihf-g++-4.6 -c -pipe -O2 -std=c++0x -Wall -W -fPIE -I../../../mkspecs/linux-arm-gnueabi-g++ -I. -o c++11.o c++11.cpp
                    arm-linux-gnueabihf-g++-4.6 -Wl,-O1 -o c++11 c++11.o
                    /usr/bin/arm-linux-gnueabihf-ld: unrecognised emulation mode: armelf_linux_eabi
                    Supported emulations: elf_x86_64 elf32_x86_64 elf_i386 i386linux elf_l1om elf_k1om
                    collect2: ld returned 1 exit status
                    make: *** [c++11] Error 1
                    C++11 disabled.
                    floatmath auto-detection... ()
                    arm-linux-gnueabihf-g++-4.6 -c -pipe -O2 -Wall -W -fPIE -I../../../mkspecs/linux-arm-gnueabi-g++ -I. -o floatmath.o floatmath.cpp
                    floatmath.cpp:44:5: warning: unused parameter ‘argc’ [-Wunused-parameter]
                    floatmath.cpp:44:5: warning: unused parameter ‘argv’ [-Wunused-parameter]
                    arm-linux-gnueabihf-g++-4.6 -Wl,-O1 -o floatmath floatmath.o
                    /usr/bin/arm-linux-gnueabihf-ld: unrecognised emulation mode: armelf_linux_eabi

                    ...

                    evdev disabled.
                    XLib auto-detection... ()
                    arm-linux-gnueabihf-g++-4.6 -c -pipe -O2 -Wall -W -fPIE -I../../../mkspecs/linux-arm-gnueabi-g++ -I. -o xlib.o xlib.cpp
                    arm-linux-gnueabihf-g++-4.6 -Wl,-O1 -o xlib xlib.o -lXext -lX11 -lm
                    /usr/bin/arm-linux-gnueabihf-ld: unrecognised emulation mode: armelf_linux_eabi
                    Supported emulations: elf_x86_64 elf32_x86_64 elf_i386 i386linux elf_l1om elf_k1om
                    collect2: ld returned 1 exit status
                    make: *** [xlib] Error 1
                    XLib disabled.
                    xcb auto-detection... ()
                    arm-linux-gnueabihf-g++-4.6 -c -pipe -O2 -Wall -W -fPIE -I../../../mkspecs/linux-arm-gnueabi-g++ -I. -o xcb.o xcb.cpp
                    xcb.cpp: In function ‘int main(int, char**)’:
                    xcb.cpp:47:23: warning: unused variable ‘t’ [-Wunused-variable]
                    arm-linux-gnueabihf-g++-4.6 -Wl,-O1 -o xcb xcb.o -lxcb
                    /usr/bin/arm-linux-gnueabihf-ld: unrecognised emulation mode: armelf_linux_eabi
                    Supported emulations: elf_x86_64 elf32_x86_64 elf_i386 i386linux elf_l1om elf_k1om
                    collect2: ld returned 1 exit status
                    make: *** [xcb] Error 1
                    xcb disabled.
                    The test for linking against libxcb failed!
                    You might need to install dependency packages for libxcb.
                    See src/plugins/platforms/xcb/README.
                    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                    END MESSAGE
                    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

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

                      You need the arm version of these libraries

                      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
                      • R Offline
                        R Offline
                        reme
                        wrote on last edited by
                        #11

                        Hi

                        I put all the xcb libraries loaded on my PANDABOARD/UBUNTU described in the README in the directory :
                        /usr/lib/gcc/arm-linux-gnueabihf/4.6 on my PC/UBUNTU.
                        But the result is always the same after the configuration :

                        xcb disabled.
                        The test for linking against libxcb failed! You might need to install dependency packages for libxcb. See src/plugins/platforms/xcb/README.

                        Best regards.

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

                          You should rather point the configure script to the folder where the libraries can be found they have dependencies that might not be seen

                          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
                          • R Offline
                            R Offline
                            reme
                            wrote on last edited by
                            #13

                            Hi

                            I modified the file /usr/lib/gcc/arm-linux-gnueabihf/4.6/pkgconfig/xcb.pc
                            thus I can specify the access to the static library libxcb.a (coming from my target). Nevertheless I obtain the same message :
                            arm-linux-gnueabihf-g++-4.6 -Wl,-O1 -o xcb xcb.o -L//usr/lib/gcc/arm-linux-gnueabihf/4.6 -lxcb

                            /usr/bin/arm-linux-gnueabihf-ld: unrecognised emulation mode: armelf_linux_eabi
                            Supported emulations: elf_x86_64 elf32_x86_64 elf_i386 i386linux elf_l1om elf_k1om
                            collect2: ld returned 1 exit status
                            make: *** [xcb] Error 1
                            xcb disabled.
                            How must I resolve the problem /usr/bin/arm-linux-gnueabihf-ld: unrecognised emulation mode: armelf_linux_eabi ?

                            Best regards.

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

                              Looking for that error, it seems you might be encountering a bug of gcc

                              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
                              • R Offline
                                R Offline
                                reme
                                wrote on last edited by
                                #15

                                Hi

                                It seems there is not any solution to my problem.

                                Best regards.

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

                                  The only I see is to update gcc, is there not a more recent version available ?

                                  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
                                  • R Offline
                                    R Offline
                                    reme
                                    wrote on last edited by
                                    #17

                                    I do not find a more recent version but I find a workaround.
                                    I am not sure to well understant it.
                                    The workaround suggests to modify the configure.tgt file for the linker :

                                    This is the linker target specific file. This is invoked by the autoconf generated configure script. Putting it in a separate shell file lets us skip running autoconf when modifying target specific.

                                    The content of the config.tgt is the following :
                                    --- ld/configure.tgt.orig 2011-04-05 20:22:23.000000000 +0000

                                                        targ_extra_emuls="armelfb armelf armelf_linux" 
                                                        targ_extra_libpath="armelf_linux" 
                                                        ;; 
                                    

                                    -arm*--linux-eabi) targ_emul=armelf_linux_eabi
                                    +arm
                                    -
                                    -linux-eabi) targ_emul=armelf_linux_eabi
                                    targ_extra_emuls=armelfb_linux_eabi
                                    targ_extra_libpath=$targ_extra_emuls

                                                        targ_extra_emuls="armelf armelfb armelfb_linux" 
                                                        targ_extra_libpath="armelfb_linux" 
                                                        ;; 
                                    

                                    -arm*--uclinuxeabi) targ_emul=armelf_linux_eabi
                                    +arm*--uclinuxeabi*) targ_emul=armelf_linux_eabi
                                    targ_extra_emuls=armelfb_linux_eabi
                                    targ_extra_libpath=$targ_extra_emuls
                                    ;;

                                    For me I need to compile the loader arm-linux-gnueabi-g++-4.6 by using the previous file.

                                    Do you agree ?

                                    Thanks and best regards.

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

                                      Worth to try

                                      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

                                      • Login

                                      • Login or register to search.
                                      • First post
                                        Last post
                                      0
                                      • Categories
                                      • Recent
                                      • Tags
                                      • Popular
                                      • Users
                                      • Groups
                                      • Search
                                      • Get Qt Extensions
                                      • Unsolved