Qt World Summit: Submit your Presentation

'No such file or directory' starting program

  • Hello

    I am trying to execute a program I compiled in QTCreator. I put on the command line:
    Then it launchs a 'sh: No such file or directory' error, as if the program is not there. But it is.

    It worked before we upgraded the computer software.

    I suppose it is something that myprogram is not finding in the upgraded system. Could it be so?
    Is there anyway to see what myprogram is looking for? Any QT debug mode applicable?

    Thank you

  • Such questions are not expected from a software developer :P

  • Hello

    Sorry to not meet your expectatives :)

    I try to explain it something more: the program work on de development PC but is not running now in the other machine. I tried to remote debug my code from QTCreator (it debugs fine on another remote machine) but the program is not entering on my routines in this machine.

    I only can suposse QT application have some initialitation code on his own. It must be searching something on the changed machine environment that has changed.

    Perhaps you can guide me on how I can trace what is happening here.

    Or it is to download the sources, compile and debug the QTCreator itself the only solution?

    Thank you

  • Hi
    You need to deploy the Qt dependencies alongside your application.
    Please see

  • Hello Graham

    Here are linux but your help showed me what I must look for (I think :) : library dependencies (http://qt-project.org/wiki/Show_library_dependencies)

    Thank you very much

    PD: thanks also to CAD_coding: he did a good job maintaining the thread alive :P

  • Go to your application folder and then run your command in command mode...

  • Hi guru

    Sorry. It sounds good but I looked for it and I am not able to find out how to start my application in command mode. All the references I found only talk about QTcreator command mode.

    Please, can you give me a link to where it is explained?

    Thank you

  • what kind of operating system did you use?

  • Hello

    I have a linux compiled with Yocto running in a iMX6Q Sabre Lite board.

    Thank you

  • Hi,
    I'm not well about yocto . Did you like to run your program through terminal mode means to go your application directory in the same terminal mode and use command ./myapp to execut your application.

  • Hello

    I think you were talking about a special mode for QT applications.

    That is what I am doing. I go to the linux console, then to my directory and then I try to run it. This is what I got:

    -sh: ./myapp: No such file or directory

    This is due, as Graham pointed, to failed dependencies. We have a new recompiled program already running with the new versions. But it would be interesting to know what file or directory is not finding the starting routines of a QT application instead of that message. As newbies we were totally confused about it when we saw it.

    Thank you any way

  • Hi,
    Now you run this command in same directory
    @ldd ./yourappname@

    this will list all your dependencies and library files, if any files missed this will show as "not found". If all files available then it will show path of such files.

  • Hello

    Yes, we saw that utility at the link posted previously.


    • ldd on the revised and working version shows the implied libraries
    • ldd on the old version shows the error:
      /usr/bin/ldd: line 115 ./myprogram : No such file or directory

    I deleted a libsomeone file used by working program and ldd does not crash. It lists libraries and it says libsomeone not found.



  • Moderators

    Is your app executable ? Or just do chmod 777 yourapp

  • Hi

    I login as root. It is -rwxr-xr-x. However I did:
    chmod 777 myapp
    chown root.root myapp

    and nothing changes:
    -sh: ./myoldapp: No such file or directory


  • Moderators

    Ok. May be its the problem related to compilation. Maybe you have compiled on a 64 bit machine and trying to run on 32 bit.

  • Hello

    I have a iMX6Q board. I upgraded the board with a linux complete image. The old image must have a Qt version and the new image is another Qt version.

    myoldprogram runs on oldimage but it does not run on newimage.

    I understood I have to recompile the program and I did so. mynewprogram runs fine in newimage.

    The 'no such file ..' error comes from broken dependencies (it seems). But the cuestions remaining is: Is there any way to display what file is not there?


  • Moderators

    To see dependencies use ldd.
    @ldd appname ¦ grep -i not@

    This will display the deps. which are not found

  • Hi

    Tested before. Not working

    Best regards

    [quote author="controlhorus" date="1380900225"]

    • ldd on the old version shows the error:
      /usr/bin/ldd: line 115 ./myprogram : No such file or directory

  • I had the same annoying problem (linux diagnostics rules!). I moved into LSB-ready linux, or moved executable from LSB linux into non-LSB one (I'm not sure now). Try to install LSB package or create fake mappings into your system libraries to simulate LSB libraries. I didn't find any tool which could diagnose this problem properly, let me know if you have one.

Log in to reply