Important: Please read the Qt Code of Conduct -

[Solved] Cross compiled application doesn't run on target (Command not found)

  • Hello!

    I am facing weird problem at my end.

    My goal is to cross compile Qt application for the specific processor and run it on the embedded target.

    Here are the steps I did follow:

    Did all the steps one by one as per:
    "Sitara TI SDK":

    After building the application, the file property shows:

    root@am335x-evm:~# file helloworld
    helloworld: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.31, not stripped

    And it does match with the pre built application:

    root@am335x-evm:~# file /usr/bin/qmlviewer
    /usr/bin/qmlviewer: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, stripped

    But when I run the application, it shows

    root@am335x-evm:~# ./helloworld -qws
    -sh: ./helloworld: not found

    What does that mean?

    How do I get rid of this problem?

    Thank you,

  • Lifetime Qt Champion


    Did you check that it has executable permissions ?

  • Hi Sam,

    Yes, the application has executable permission.

    root@am335x-evm:~# ls -l
    -rwxrwxrwx 1 root root 8197 Jul 27 10:55 helloworld

    (Sorry for the wrong date, clock has not been set properly)

  • Sounds like the loader can't load it.
    Shell into your board and run

    Ldd ./helloworld

    To see what depends are missing

  • Greg!

    Thank you for the response.

    You might be corect about the loader - loader can't load it.

    Unfortunately, "ldd" binary is not present with the busybox. So, I am not able to see the shared drivers details.

    But, this application has been built in Ubuntu environment and copied to the target.

    Here are the details that is displayed in Ubuntu:

    @ubuntu:~/exercise/lab1$ ldd ./helloworld
    not a dynamic executable

    What does that mean?

    But, when i see the properties of other application which I built for Ubuntu, that shows different information:

    k@ubuntu:~/exercise/translatorDemo/FormData$ ldd ./FormData => (0xb770d000) => /usr/local/Trolltech/Qt-X11-4.7.1/lib/ (0xb6c6a000) => /usr/local/Trolltech/Qt-X11-4.7.1/lib/ (0xb69cc000) => /usr/lib/i386-linux-gnu/ (0xb68d5000) => /lib/i386-linux-gnu/ (0xb68b7000) => /lib/i386-linux-gnu/ (0xb670d000) => /lib/i386-linux-gnu/ (0xb66f2000) => /lib/i386-linux-gnu/ (0xb65f9000) => /lib/i386-linux-gnu/ (0xb65e2000) => /usr/lib/i386-linux-gnu/ (0xb6548000) => /usr/lib/i386-linux-gnu/ (0xb653f000) => /usr/lib/i386-linux-gnu/ (0xb6525000) => /usr/lib/i386-linux-gnu/ (0xb651b000) => /usr/lib/i386-linux-gnu/ (0xb64e6000) => /usr/lib/i386-linux-gnu/ (0xb64d4000) => /usr/lib/i386-linux-gnu/ (0xb63a0000) => /lib/i386-linux-gnu/ (0xb6374000) => /lib/i386-linux-gnu/ (0xb636f000) => /lib/i386-linux-gnu/ (0xb6365000)
    /lib/ (0xb770e000) => /lib/i386-linux-gnu/ (0xb6329000) => /lib/i386-linux-gnu/ (0xb6323000) => /lib/i386-linux-gnu/ (0xb62f9000) => /usr/lib/i386-linux-gnu/ (0xb62d8000) => /usr/lib/i386-linux-gnu/ (0xb62d3000) => /usr/lib/i386-linux-gnu/ (0xb62cc000)

    Please let me know your thoughts.

    Thank you,

  • Aah OK! I think,

    not a dynamic executable

    means that, it is not really an executable for the particular platform.

    In this case, I have cross compiled the application for ARM platform and am trying to execute it in Linux environment, which is not really possible!

  • Yes.
    It will have to be run on the target system.
    I found a post online that may help:

    You really don't need a special ldd.
    ldd is just a script. In its most basic usage (ldd <executable>), it just runs:

    LD_TRACE_LOADED_OBJECTS=1 <executable>

    For example on busybox:

    LD_TRACE_LOADED_OBJECTS=1 /bin/busybox =>  (0x00100000) => /lib/ (0x0fe70000) 
        /lib/ (0x48000000 

    So for sporadic usage, an ldd script isn't even needed.

    See 'man' for information on this LD_TRACE_LOADED_OBJECTS
    variable (and several other useful variables that change the behavior
    of the executable.

    See also:

  • Hi Greg,

    Thank you for the response and sorry for delayed reply.

    I did find the solution.

    My target was running on 5.05 version of SDK and I was cross compiling for 7.0 version of SDK. Because of mismatch in the version, I was not able to execute the application.

    After loading the right version of SDK, I was able to run the application in embedded device.

    Thank you for the help!


Log in to reply