install qcharts module to yocto sdk



  • I try to cross-compile qt chart example for a yocto platform. I do following steps to compile my qt programs:

    • source /opt/myimage/2.1.2/environment-setup-cortexa9hf-neon-poky-linux-gnueabi
    • qmake -o Makefile areachart.pro
    • make

    But When I add QT += charts to any project run qmake like qmake -o Makefile areachart.pro I hit this error:

    Project ERROR: Unknown module(s) in QT: charts

    Here is the output of qmake -v:

    QMake version 3.0
    Using Qt version 5.7.0 in /opt/myimage/2.1.2/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/lib
    

    Should I should add qtcharts module my yocto SDK to be able to compile the example? if yes how?

    For some reasons I was able to cross-compiled Qt from source using qtcreator and get the binary files for qt examples and qtchart library itself. I aslo run the qt examples on my target platform by putting resulting libQtCharts.so and other files manually in /usr/lib/ and /usr/include/ on the target and I was able to draw the charts on target.

    However, what I need is to include the charts in my project and run qmake steps as mentioned above. But what I get is the Project ERROR: Unknown module(s) in QT: charts
    I have tried to put libQtCharts.so which I got from compiling qt source manually in /opt/myimage/2.1.2/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/lib but still not able to get the make file with qmake -o Makefile areachart.pro

    Another thing that I cannot understand is that why I can cross-compile qtchart from source by openning it in qtcreator and pressing build button but I am not able to do the same withqmake -o Makefile qtchart.pro and make


  • Moderators

    @pehi said in install qcharts module to yocto sdk:

    qmake -o Makefile qtchart.pro

    This will most probably call qmake from your Linux distribution Qt, not your cross compiled one.
    Use full path to your cross compiled qmake.

    Also the error message you wanted to post isn't visibla (sharing images in this forum often doesn't work).



  • @jsulm thanks for reply.

    This will most probably call qmake from your Linux distribution Qt, not your cross compiled one.
    Use full path to your cross compiled qmake.

    But since I have sourced the environment-setup-cortexa9hf-neon-poky-linux-gnueabi script it should be the correct qmake. I have compile the project for my targe with the same qmake successfully but when I add charts module to my .pro file the qmake cannot detect it. Bye the way I have tried to find other qmake binary files on my machine and I found one which is a qmake binary file for the target platform and obviously it cannot be executed from my development machine. so if I run it
    cd /opt/myimage/2.1.2/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/bin/qt5/.debug/$
    ./qmake -v and I get this error:
    -bash: ./qmake: cannot execute binary file: Exec format error

    Also the error message you wanted to post isn't visibla (sharing images in this forum often doesn't work).

    thanks for reminding, I have updated it it was actually a text in a wrong format that has been hidden.


  • Moderators

    @pehi said in install qcharts module to yocto sdk:

    -bash: ./qmake: cannot execute binary file: Exec format error

    Looks like this qmake was built for your target hardware and not the host machine.
    You can check this:

    file qmake
    

    If you cross compiled Qt you should have a qmake for it which was built for x86.



  • @jsulm

    Looks like this qmake was built for your target hardware and not the host machine.
    You can check this:

    file qmake
    

    If you cross compiled Qt you should have a qmake for it which was built for x86.

    Yes, correct . I am able to cross compile my application with this qmake:
    /opt/myimage/2.1.2/sysroots/x86_64-pokysdk-linux/usr/bin/qt5/qmake

    But it fails to recognize the qchart module when I add a qchart to my project .pro file and so strange that I can cross-compile qtchart from source with qtcreator but not able to do so with for my own project.
    additionally can do qmake on qtchart source code but when I run make it fails with error:

    BEGIN failed--compilation aborted at /opt/myimage/2.1.2/sysroots/x86_64-pokysdk-linux/usr/bin/qt5/syncqt.pl line 55
    Project ERROR: Failed to run: perl -w /opt/myimage/2.1.2/sysroots/x86_64-pokysdk-linux/usr/bin/qt5/syncqt.pl -module QtCharts -version 5.7.1 -outdir /home/pehen/prg/qtcharts /home/pehen/prg/qtcharts
    


  • I have found the problem finally. I need to add this qtchart module to the meta-toolchain sdk in
    following file: <meta-qt5> /recipes-qt/packagegroups/packagegroup-qt5-toolchain-target.bb here is the patch for it also:
    https://patchwork.openembedded.org/patch/147962/

    then I build the sdk by
    bitbake meta-toolchain-qt
    and reinstall by:
    rm -rf /opt/myimage/
    and executing this scripts:
    poky/build/tmp/deploy/sdk/myimage-glibc-x86_64-meta-toolchain-qt5-cortexa9hf-neon-toolchain.sh
    So now I do have a new /opt/myimage and I can run qmake on .pro file with a QT += charts module.


Log in to reply
 

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