我想要获取 Gridwars 可执行文件请求的库列表。
我一年前使用过 ldd,但是
moi@myComputer:/opt/gridwars/gridwars_lin$ ldd gridwars
not a dynamic executable
浏览互联网后,我发现
moi@myComputer:/opt/gridwars/gridwars_lin$ readelf -d gridwars
Dynamic section at offset 0x70014 contains 27 entries:
Tag Type Name/Value
0x00000001 (NEEDED) Shared library: [libX11.so.6]
0x00000001 (NEEDED) Shared library: [libGL.so.1]
0x00000001 (NEEDED) Shared library: [libGLU.so.1]
0x00000001 (NEEDED) Shared library: [libXxf86vm.so.1]
0x00000001 (NEEDED) Shared library: [libstdc++.so.5]
0x00000001 (NEEDED) Shared library: [libm.so.6]
0x00000001 (NEEDED) Shared library: [libpthread.so.0]
0x00000001 (NEEDED) Shared library: [libc.so.6]
0x0000000c (INIT) 0x804a284
0x0000000d (FINI) 0x80b29bd
0x00000004 (HASH) 0x8048168
0x00000005 (STRTAB) 0x8049268
0x00000006 (SYMTAB) 0x8048678
0x0000000a (STRSZ) 2091 (bytes)
0x0000000b (SYMENT) 16 (bytes)
0x00000015 (DEBUG) 0x0
0x00000003 (PLTGOT) 0x80b811c
0x00000002 (PLTRELSZ) 1408 (bytes)
0x00000014 (PLTREL) REL
0x00000017 (JMPREL) 0x8049d04
0x00000011 (REL) 0x8049cd4
0x00000012 (RELSZ) 48 (bytes)
0x00000013 (RELENT) 8 (bytes)
0x6ffffffe (VERNEED) 0x8049c14
0x6fffffff (VERNEEDNUM) 4
0x6ffffff0 (VERSYM) 0x8049a94
0x00000000 (NULL) 0x0
是的,我有一个请求的共享对象的列表。但这仍然给我带来一些麻烦:我无法理解两件事……
正如评论中所建议的,我们可能希望在可执行文件上运行文件实用程序。
moi@mycomputer:/opt/gridwars/gridwars_lin$ file gridwars
gridwars: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.2.0, stripped
我如何检查一个“.so”文件/共享对象是否可用?
为什么 gridwars 可执行文件不是可执行文件?我记得它是可执行文件,甚至还找到了一个由三个字母组成的神奇命令,它列出了请求的共享对象以及是否有可用的共享对象。
谢谢你的帮助。
答案1
安装以下软件包后,
sudo apt-get install libc6:i386
sudo apt-get install libxxf86vm1:i386
sudo apt-get install libglu1-mesa:i386
sudo apt-get install libstdc++5:i386
你得到
moi@somewhere:/opt/gridwars/gridwars_lin$ ldd gridwars
linux-gate.so.1 => (0xf77b2000)
libX11.so.6 => /usr/lib/i386-linux-gnu/libX11.so.6 (0xf765d000)
libGL.so.1 => /usr/lib/i386-linux-gnu/mesa/libGL.so.1 (0xf7604000)
libGLU.so.1 => /usr/lib/i386-linux-gnu/libGLU.so.1 (0xf757c000)
libXxf86vm.so.1 => /usr/lib/i386-linux-gnu/libXxf86vm.so.1 (0xf7576000)
libstdc++.so.5 => /usr/lib/i386-linux-gnu/libstdc++.so.5 (0xf74bc000)
libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xf7479000)
libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xf745e000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf72a9000)
libxcb.so.1 => /usr/lib/i386-linux-gnu/libxcb.so.1 (0xf7287000)
libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xf7282000)
libglapi.so.0 => /usr/lib/i386-linux-gnu/libglapi.so.0 (0xf726b000)
libXext.so.6 => /usr/lib/i386-linux-gnu/libXext.so.6 (0xf7259000)
libXdamage.so.1 => /usr/lib/i386-linux-gnu/libXdamage.so.1 (0xf7254000)
libXfixes.so.3 => /usr/lib/i386-linux-gnu/libXfixes.so.3 (0xf724d000)
libX11-xcb.so.1 => /usr/lib/i386-linux-gnu/libX11-xcb.so.1 (0xf724a000)
libxcb-glx.so.0 => /usr/lib/i386-linux-gnu/libxcb-glx.so.0 (0xf7232000)
libxcb-dri2.so.0 => /usr/lib/i386-linux-gnu/libxcb-dri2.so.0 (0xf722d000)
libdrm.so.2 => /usr/lib/i386-linux-gnu/libdrm.so.2 (0xf721f000)
libstdc++.so.6 => /usr/lib/i386-linux-gnu/libstdc++.so.6 (0xf7136000)
libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xf7119000)
/lib/ld-linux.so.2 (0xf77b3000)
libXau.so.6 => /usr/lib/i386-linux-gnu/libXau.so.6 (0xf7115000)
libXdmcp.so.6 => /usr/lib/i386-linux-gnu/libXdmcp.so.6 (0xf710e000)
游戏可以正常运行。
答案2
如何安装 Gridwars 2
打开终端并运行以下命令:
mkdir gridwars && cd gridwars
wget http://gridwars.marune.de/bin/gridwars_lin.zip
unzip gridwars_lin.zip
./gridwars
然后我收到这个错误:
[wilf@comp gridwars]$ ./gridwars
./gridwars: error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory
所以我不得不安装 libstdc 5- 我 - 我找到一个 rpm而是在我的 Fedora 19 机器上安装了它。
然后它运行得很好 - 很棒的游戏