“No such file or directory” but it exists

前端 未结 13 2029
南笙
南笙 2020-11-29 21:24

I simply want to run an executable from the command line, ./arm-mingw32ce-g++, but then I get the error message,

bash: ./arm-mingw32ce-g++: No s         


        
13条回答
  •  半阙折子戏
    2020-11-29 22:03

    As mentioned by others, this is because the loader can't be found, not your executable file. Unfortunately the message is not clear enough.

    You can fix it by changing the loader that your executable uses, see my thorough answer in this other question: Multiple glibc libraries on a single host

    Basically you have to find which loader it's trying to use:

    $ readelf -l arm-mingw32ce-g++ | grep interpreter
      [Requesting program interpreter: /lib/ld-linux.so.2]
    

    Then find the right path for an equivalent loader, and change your executable to use the loader from the path that it really is:

    $ ./patchelf --set-interpreter /path/to/newglibc/ld-linux.so.2 arm-mingw32ce-g++
    

    You will probably need to set the path of the includes too, you will know if you want it or not after you try to run it. See all the details in that other thread.

提交回复
热议问题