Configuration issue (sysroot, libraries) when build yocto Qt5 for beaglebone



  • Hello,

    I'm using Yocto and configures a dedicated kit to the cross compilation environment for beagle bone black.
    When I tried to compile a "helloworld" program I had a linking issue.

    Host: ubuntu 16.04 64 Bit, YP Core - Krogoth 2.1.1(Yocto), Qt 5.6.1

    I bitbake @bitbake meta-toolchain-qt5@ and the output :
    @/home/fanning/data/yocto_bbb/build/tmp/deploy/sdk@

    I run scrip @poky-glibc-x86_64-meta-toolchain-qt5-cortexa8hf-neon-toolchain-2.1.1.sh@ and the output save to /opt.

    QtCreator configuration

    I did update qtcreator.sh to set the env variable required for cross compilation
    Sysyroot: @/opt/poky/2.1.1/sysroots/x86_64-pokysdk-linux@
    Compiler: @/opt/poky/2.1.1/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++ @
    QtVersion: @/opt/poky/2.1.1/sysroots/x86_64-pokysdk-linux/usr/bin/qt5/qmake@(qt 5.6.2).
    Debug: @/opt/poky/2.1.1/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gdb@

    The issue
    When I tried to compile my "Hello" program (named QtVersion and writing the version of Qt in a console), the linker is giving me the following error.

    g++ -o QtVersion main.o -lQt5Core -lpthread
    /usr/bin/ld: cannot find -lQt5Core

    When i try:
    @INCLUDEPATH += /opt/poky/2.1.1/sysroots/cortexa8hf-neon-poky-linux-gnueabi/usr/include@
    @LIBS += /opt/poky/2.1.1/sysroots/cortexa8hf-neon-poky-linux-gnueabi/usr/lib/*.so@ into .pro file on Qt then error

    Error: @/opt/poky/2.1.1/sysroots/cortexa8hf-neon-poky-linux-gnueabi/usr/lib/libBrokenLocale.so: error adding symbols: File in wrong format@

    I hope you will be able to help me to solve it.

    Thx and rgds,
    Fanning


  • Moderators

    @Fanning said in Configuration issue (sysroot, libraries) when build yocto Qt5 for beaglebone:

    LIBS += /opt/poky/2.1.1/sysroots/cortexa8hf-neon-poky-linux-gnueabi/usr/lib/*.so

    Are you adding ALL libs?
    If it says wrong format then you're probably using wrong compiler (your host compiler?).
    You call

    g++ -o QtVersion main.o -lQt5Core -lpthread
    

    What is g++ in this case (you can check calling 'which g++')? It should be your cross- compiler not the host x86 compiler. You can specify the whole path to the compiler.



  • Hi, thank for your rep !

    If i change like this: @LIBS += /opt/poky/2.1.1/sysroots/cortexa8hf-neon-poky-linux-gnueabi/usr/lib/Qt.so@

    Error:
    g++ -o BBB main.o /opt/poky/2.1.1/sysroots/cortexa8hf-neon-poky-linux-gnueabi/usr/lib/Qt.so -lQt5Core -lpthread
    /opt/poky/2.1.1/sysroots/cortexa8hf-neon-poky-linux-gnueabi/usr/lib/libQt53DCore.so: error adding symbols: File in wrong format.

    I check @which g++@ the output @/usr/bin/g++@

    What i can do to change compiler arm-poky-linux on Qt ?



  • Hi Fanning,

    have you any solution?

    Thanks,
    Tasi



  • @Fanning said in Configuration issue (sysroot, libraries) when build yocto Qt5 for beaglebone:

    Hello,

    I'm using Yocto and configures a dedicated kit to the cross compilation environment for beagle bone black.
    When I tried to compile a "helloworld" program I had a linking issue.

    Host: ubuntu 16.04 64 Bit, YP Core - Krogoth 2.1.1(Yocto), Qt 5.6.1

    I bitbake @bitbake meta-toolchain-qt5@ and the output :
    @/home/fanning/data/yocto_bbb/build/tmp/deploy/sdk@

    I run scrip @poky-glibc-x86_64-meta-toolchain-qt5-cortexa8hf-neon-toolchain-2.1.1.sh@ and the output save to /opt.

    QtCreator configuration

    I did update qtcreator.sh to set the env variable required for cross compilation
    Sysyroot: @/opt/poky/2.1.1/sysroots/x86_64-pokysdk-linux@

    Hi, for me the problem is your sysroot path in Qt creator:

    /opt/poky/2.1.1/sysroots/x86_64-pokysdk-linux

    Path of sysroot need to be something like this :

    /opt/poky/1.6.3/sysroots/armv6-vfp-poky-linux-gnueabi/

    This path is according to my raspberrypi build (with daisy branch of meta-raspberry)

    So i think that path of your sysroot should be something like this:

    /opt/poky/2.1.1/sysroots/cortexa8hf-neon-poky-linux-gnueabi

    Hope this can help you, if not keep me informed



  • Hi mostefa,

    I setting like you, but error still occurs
    "/usr/bin/ld: cannot find -lQt5Core"

    Thanks,
    Tasi



  • @tasi

    Try to :

    1. close qtcreator
    2. where your qtcreator is installed , open your qtcreator.sh wih gedit and add the following line:

    source /opt/poky/2.1.1/sysroots/cortexa8hf-neon-poky-linux-gnueabi

    on the top of your qtcreator.sh

    and save ,

    Run your qtcreator again and see if it is better,

    I also advise to install a new clean version of qtcreator , (maybe your env variable are not good now)

    this version worked for me with raspberrypi:

    http://download.qt-project.org/official_releases/qtcreator/3.2/3.2.2/qt-creator-opensource-linux-x86_64-3.2.2.run

    and then do the step i described.

    Waiting for your feedback !


  • Moderators

    @tasi @mostefa I would not do any hacks like editing qtcreator.sh! This is not the clean solution.
    You just need to set-up your Kit for cross-compilation correctly in QtCreator: select correct compiler and correct Qt version.
    Did you actually set-up a Kit?



  • @jsulm said in Configuration issue (sysroot, libraries) when build yocto Qt5 for beaglebone:

    @tasi @mostefa I would not do any hacks like editing qtcreator.sh! This is not the clean solution.
    You just need to set-up your Kit for cross-compilation correctly in QtCreator: select correct compiler and correct Qt version.
    Did you actually set-up a Kit?

    AFAIK, this is a common practice, for embedded device !!!

    https://community.nxp.com/thread/309578

    https://community.nxp.com/docs/DOC-95251

    http://wiki.hioproject.org/index.php?title=HIO_Wiki:Set_Up_Qt_Creator_for_Yocto_Device



  • This post is deleted!

Log in to reply
 

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