Important: Please read the Qt Code of Conduct -

Get Qt example running on SAM9N12

  • Hi,

    I'm new to Qt, but I hope my question is not basic...
    I'm trying to get a example running on my Evaluation board Sam9N12-Ek with Linux 3.10 and buildroot with qt 4.8.6. I can run the examples with: ./example -qws linuxfb .Works perfekt.
    Now I made a own Qt-Gui-Application on my Ubuntu 14.04. Run&Build is ok.
    Now i probably have to compile it for the embedded linux.
    I did:
    export QTCHOOSER_RUNTOOL=qtconfig
    export QT_SELECT=4
    qmake -r -spec linux-arm-gnueabi-g++
    But i can't run the Application on the board...
    For the other things i used: make CROSS_COMPILE=arm-none-eabi-
    But this compiler is not avalible in 4.8.6 libary. (qt-everywhere-opensource-src-4.8.6.tar.gz with this setup:

    I' runnin out of google...Does anyone have some hints for me?
    Thanks a lot

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Did you cross-compile Qt for your board ? If so, the just call the qmake from that version of Qt to build your project

  • I have a cross-compiled Qt-Version from on the Evaluation-Board, but it doesn't know the qmake command, sadly...

  • Well i didn't see this post:
    I'll give it a try!

  • HI, sorry to bother you again. I crosscompiled everything like explained:

    With the qtcreator 5.4.1 i choose at build&run the libaries for qt4.8.5 und arm-linux-gnueabihf-g++ . If i run it everything gets compiled, no errors occure.

    Then i copied the files to a usb stick and try to run it from the usb-stick with: ./example -qws linuxfb but something with bash sh occures... I also tried chmod but nothing changed.

    Two questions:

    • list itemThe rest of the board software is compiled with CROSS_COMPILE=arm-none-eabi- : Do i have to compile qt also with arm-none-eabi- or should gcc-linaro-arm-linux-gnulist itemeabihf- also work?

    • Does the qtcreator also needed to be crosscompiled?

  • Lifetime Qt Champion

    What exact error are you getting ?

    Unless you plan to run Qt Creator on your board, no

  • On board the board: -sh: ./example: not found

  • Lifetime Qt Champion

    What does file example return ?

  • On the SAM9N12-Linux "file" is not installed but on ubuntu(compiling PC) it says:
    benephil: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 3.1.1, BuildID[sha1]=00493b39dc19cde81d1b1ac906499c24698e97f4, not stripped

  • Lifetime Qt Champion

    Good, but the thing is, it doesn't seems that the file is copied over to the target

  • Sorry, I don't get it. What do you meen?
    I copied the folder with the crosscompiled files from my PC to a usb-stick, mounted the usb-stick on the Evaluationboard and tried to run the example.

  • Lifetime Qt Champion

    Then that's normal, the libraries can't be found, you should write a little bash script that setups the environment for your application to run. Have a look at the Linux Deployment Guide for more details about this

  • Ok so i probably have some libary issues... With crosscompilation everything should be fine? Do i have to write a bash script for those libaries?:

    "ldd example"
    checking sub-depends for '/usr/lib/'
    checking sub-depends for '/usr/lib/'
    checking sub-depends for '/usr/lib/'
    checking sub-depends for '/lib/' => /lib/ (0xb6f60000) => /lib/ (0xb6f54000) => /lib/ (0xb6efb000)
    checking sub-depends for '/usr/lib/'
    checking sub-depends for 'not found'
    checking sub-depends for '/lib/'
    checking sub-depends for 'not found'
    checking sub-depends for '/usr/lib/'
    checking sub-depends for '/usr/lib/'
    checking sub-depends for '/usr/lib/'
    checking sub-depends for '/usr/lib/'
    checking sub-depends for '/lib/' => /lib/ (0xb6ed4000) => /lib/ (0xb6f2d000)
    checking sub-depends for '/lib/' => /lib/ (0xb6f4e000)
    checking sub-depends for '/lib/' => /lib/ (0xb6ee9000) => /lib/ (0xb6f42000)
    checking sub-depends for '/lib/' => /lib/ (0xb6eda000) => /lib/ (0xb6ece000) => /lib/ (0xb6eb2000) => /lib/ (0xb6f33000)
    checking sub-depends for '/usr/lib/' => /usr/lib/ (0x00000000) => /usr/lib/ (0x00000000) => /usr/lib/ (0x00000000) => /lib/ (0x00000000) => /usr/lib/ (0x00000000) => not found (0x00000000) => /lib/ (0x00000000) => not found (0x00000000) => /usr/lib/ (0x00000000) => /usr/lib/ (0x00000000) => /usr/lib/ (0x00000000) => /usr/lib/ (0x00000000) => /lib/ (0x00000000) => /lib/ (0x00000000) => /lib/ (0x00000000) => /lib/ (0x00000000)
    /lib/ => /lib/ (0x00000000) => /usr/lib/ (0x00000000)
    not a dynamic executable

  • Hey, i observed one thing: If i run the project in qtcreator and check the "run in terminal" i get a: "Syntax error: word unexpected (expecting ")") "
    Is there something i can/should do about this issue? Because if i run "sh example" i get the same error.

  • Lifetime Qt Champion

    What distribution is running on your board ?

  • At91linux with buildroot-rfs

  • Lifetime Qt Champion

    Did you install Qt 4 directly through Buildroot ?

  • Yes, i did

  • no further ideas?

  • Lifetime Qt Champion

    Did you also cross-compile Qt using the libraries from Buildroot ?

  • On the dev machine no, on the evaluationboard yes

  • Lifetime Qt Champion

    Just to be sure I understand you correctly: you cross-compiled Qt on your desktop using a different set of libraries rather that than the one from your evaluation board and you compiled natively on your device ?

  • Yes, but it should be the same version. Buildroot uses 4.8.6 and on the dev machine i also had 4.8.6

  • Lifetime Qt Champion

    Same Qt version is one thing, but it looks like you don't have the same set of dependencies between both versions and maybe not the same set of options given to configure

  • Ok thanks, do you have any hints what i have to look for, to get the same dependencies?

  • Lifetime Qt Champion

    Use your device root filesystem as sysroot to cross-compile Qt

  • Ok i added the compiled sysroot that i compiled with buildroot. I got the same error:
    Here is a screenshot incl. the syntac error when I'm building the project:

  • Hi, sorry but doesn't any one have an idea?

  • Lifetime Qt Champion

    What do you have where the syntax error occurs ?