Search code examples
qtgccdebianqmaketoolchain

Qt cannot execute existing remote file: No such file or directory


Good day,

I have cross-compiled Qt 5.1.1 for an IMX6 powered Nitrogen6x running Debian Wheezy. However if I try to run a project created with Qt Creator on the host I receive an error claiming that said file or directory would not exist, although it does.

Qt successfully deploys my project files and finishes the make step without any problems. Executing the file through the console delivers the same error Qt delivers.

I don't think that it's a rights problem since Qt is logged in via ssh as root.

The toolchain I am using is the arm-linux-gnueabihf-gcc-4.6 which I used for cross-compiling too. It is located on the host machine.

Summary: A file that definitely is existing and is in the right place cannot be executed.

Does anyone has an idea how to fix this issue?

Thanks a lot!


Solution

  • In these cases, most of the times the "No such file or directory" doesn't mean that your executable isn't there, but that the ELF interpreter for your executable cannot be found. So:

    1. What does file executable say? It might have been compiled for the wrong architecture
    2. What does readelf -l executable say under the INTERP section? It might be requiring an interpreter not present on the target system, that's mostly due to a toolchain misconfiguration (either the mkspecs were wrong, but most likely gcc, ld and the other binutils have been configured with wrong paths).