问题描述
我有一个简单的测试程序,运行时我会得到:
I have a simple test program that when I run I get:
./hello: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory
我这样链接它:
$(CC) $(CCFLAGS) -o hello hello.o -L../ocilib-3.9.3/src/.libs -L../instantclient_11_2 -locilib
我的LD_LIBRARY_PATH包含以下内容:
My LD_LIBRARY_PATH contains this:
LD_LIBRARY_PATH=../ocilib-3.9.3/src/.libs:../instantclient_11_2:/usr/lib
/usr/lib看起来像这样:
/usr/lib looks like this:
Linux$ ls -l /usr/lib/libaio*
lrwxrwxrwx 1 root root 15 Nov 5 2008 /usr/lib/libaio.so.1 -> libaio.so.1.0.1
-rwxr-xr-x 1 root root 2632 Sep 16 2005 /usr/lib/libaio.so.1.0.0
-rwxr-xr-x 1 root root 2628 Sep 16 2005 /usr/lib/libaio.so.1.0.1
ldd hello的输出:
Output of ldd hello:
libocilib.so.3 => ../ocilib-3.9.3/src/.libs/libocilib.so.3 (0x0000002a95558000)
libc.so.6 => /lib64/tls/libc.so.6 (0x0000003811200000)
libclntsh.so.11.1 => ../instantclient_11_2/libclntsh.so.11.1 (0x0000002a956c4000)
/lib64/ld-linux-x86-64.so.2 (0x000000552aaaa000)
libnnz11.so => ../instantclient_11_2/libnnz11.so (0x0000002a97f56000)
libdl.so.2 => /lib64/libdl.so.2 (0x0000003811500000)
libm.so.6 => /lib64/tls/libm.so.6 (0x0000003811700000)
libpthread.so.0 => /lib64/tls/libpthread.so.0 (0x0000003811b00000)
libnsl.so.1 => /lib64/libnsl.so.1 (0x0000003819000000)
libaio.so.1 => not found
我希望这里缺少一些简单的东西. oracle Instantclient软件包似乎需要libaio,但是似乎已经安装了,所以出了什么问题?
I'm hoping that I'm missing something simple here. The oracle instantclient package appears to require libaio, but that seems to be installed already so what's the problem?
推荐答案
它看起来像是32/64位不匹配. ldd 输出显示,主要选择了/lib64
中的库.这表明您已经安装了64位版本的Oracle客户端并创建了64位可执行文件.但是libaio.so
可能是32位库,不能用于您的应用程序.
It looks like a 32/64 bit mismatch. The ldd output shows that mainly libraries from /lib64
are chosen. That would indicate that you have installed a 64 bit version of the Oracle client and have created a 64 bit executable. But libaio.so
is probably a 32 bit library and cannot be used for your application.
因此,您需要64位版本的libaio或创建32位版本的应用程序.
So you either need a 64 bit version of libaio or you create a 32 bit version of your application.
这篇关于libaio.so.1:无法打开共享库文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!