当二进制文件存在时,为什么会出现“找不到命令”?

nul*_*ace 10 linux virtualbox ubuntu libraries

这是我的问题。我刚刚tests在我的 VirtualBox VM 中编译了一个 linux 版本。当我运行它时,我得到:

bash: ./tests: No such file or directory
Run Code Online (Sandbox Code Playgroud)

我做了一些研究,发现它可能是权限、缺少库或不同的架构。所以我检查了那些:

  • ls -al tests

    -rwxr-xr-x 1 me me 9948598 2011-02-21 01:54 tests
    
    Run Code Online (Sandbox Code Playgroud)
  • file tests

    tests: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, not stripped
    
    Run Code Online (Sandbox Code Playgroud)
  • uname -a

    Linux DevBox 2.6.35-25-generic #44-Ubuntu SMP Fri Jan 21 17:40:44 UTC 2011 x86_64 GNU/Linux
    
    Run Code Online (Sandbox Code Playgroud)
  • ldd tests

    linux-vdso.so.1 =>  (0x00007fff7db90000)
    libpthread.so.0 => /lib/libpthread.so.0 (0x00007f10ef14c000)
    libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f10eee46000)
    libz.so.1 => /lib/libz.so.1 (0x00007f10eec2d000) 
    libm.so.6 => /lib/libm.so.6 (0x00007f10ee9aa000)
    libc.so.6 => /lib/libc.so.6 (0x00007f10ee627000)
    /lib/ld64.so.1 => /lib64/ld-linux-x86-64.so.2 (0x00007f10ef384000)
    libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007f10ee410000)
    
    Run Code Online (Sandbox Code Playgroud)

这里有什么问题?

Dar*_*har 7

看看这个:https : //stackoverflow.com/questions/1562071/how-can-i-find-which-elf-dependency-is-not-fulfill

  • 所以出于某种原因,我错过了一个链接:`sudo ln -s /lib/ld-linux-x86-64.so.2 /lib/ld64.so.1` 使它工作。有人知道这是为什么吗?我接受这个因为它是最接近和最有用的。 (3认同)