Linux libaio.so.1:无法打开共享对象文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10619298/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-06 06:21:24  来源:igfitidea点击:

libaio.so.1: cannot open shared object file

linuxoracleoci

提问by wytten

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

I link it like this:

我这样链接:

$(CC) $(CCFLAGS) -o hello hello.o -L../ocilib-3.9.3/src/.libs -L../instantclient_11_2 -locilib

My LD_LIBRARY_PATH contains this:

我的 LD_LIBRARY_PATH 包含这个:

LD_LIBRARY_PATH=../ocilib-3.9.3/src/.libs:../instantclient_11_2:/usr/lib

/usr/lib looks like this:

/usr/lib 看起来像这样:

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

Output of ldd hello:

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

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?

我希望我在这里遗漏了一些简单的东西。oracle Instantclient 包似乎需要 libaio,但它似乎已经安装,所以有什么问题?

采纳答案by Codo

It looks like a 32/64 bit mismatch. The lddoutput shows that mainly libraries from /lib64are 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.sois probably a 32 bit library and cannot be used for your application.

看起来像是 32/64 位不匹配。所述LDD输出显示,主要从库/lib64中选择的。这表明您已经安装了 64 位版本的 Oracle 客户端并创建了一个 64 位可执行文件。但libaio.so可能是一个 32 位库,不能用于您的应用程序。

So you either need a 64 bit version of libaio or you create a 32 bit version of your application.

因此,您要么需要 64 位版本的 libaio,要么创建 32 位版本的应用程序。

回答by useher

Here on a openSuse 12.3 the solution was installing the 32-bit version of libaio in addition. Oracle seems to need this now, although on 12.1 it run without the 32-bit version.

在 openSuse 12.3 上,解决方案是另外安装 32 位版本的 libaio。Oracle 现在似乎需要这个,尽管它在 12.1 上运行时没有 32 位版本。

回答by user2981810

I had the same problem, and it turned out I hadn't installed the library.

我遇到了同样的问题,结果我没有安装库。

this link was super usefull.

这个链接超级有用。

http://help.directadmin.com/item.php?id=368

http://help.directadmin.com/item.php?id=368

回答by Praveen Kumar K R

Type the following:

键入以下内容:

sudo apt-get install libaio1 libaio-dev

or

或者

sudo yum install libaio

回答by mutex86

I'm having a similar issue.

我有一个类似的问题。

I found

我发现

conda install pyodbc

conda 安装 pyodbc

is wrong!

是错的!

when I use

当我使用

apt-get install python-pyodbc

apt-get 安装 python-pyodbc

I solved this problem。

我解决了这个问题。

回答by aemaem

I had to do the following (in Kubuntu 16.04.3):

我必须执行以下操作(在 Kubuntu 16.04.3 中):

  1. Install the libraries: sudo apt-get install libaio1 libaio-dev
  2. Find where the library is installed: sudo find / -iname 'libaio.a' -type f--> resulted in /usr/lib/x86_64-linux-gnu/libaio.a
  3. Add result to environment variable: export LD_LIBRARY_PATH="/usr/lib/oracle/12.2/client64/lib:/usr/lib/x86_64-linux-gnu"
  1. 安装库: sudo apt-get install libaio1 libaio-dev
  2. 找到库的安装位置:sudo find / -iname 'libaio.a' -type f--> 导致/usr/lib/x86_64-linux-gnu/libaio.a
  3. 将结果添加到环境变量: export LD_LIBRARY_PATH="/usr/lib/oracle/12.2/client64/lib:/usr/lib/x86_64-linux-gnu"

回答by Good Will

In case one does not have sudo privilege, but still needs to install the library.

如果没有 sudo 权限,但仍需要安装库。

Download source for the software/library using:

使用以下方法下载软件/库的源代码:

apt-get source libaio

or

或者

wget https://src.fedoraproject.org/lookaside/pkgs/libaio/libaio-0.3.110.tar.gz/2a35602e43778383e2f4907a4ca39ab8/libaio-0.3.110.tar.gz

unzip the library

解压缩库

Install with the following command to user-specific library:

使用以下命令安装到用户特定的库:

make prefix=`pwd`/usr install #(Copy from INSTALL file of libaio-0.3.110)

or

或者

make prefix=/path/to/your/lib/libaio install

Include libaio library into LD_LIBRARY_PATH for your app:

将 libaio 库包含到您的应用程序的 LD_LIBRARY_PATH 中:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/your/lib/libaio/lib

Now, your app should be able to find libaio.so.1

现在,您的应用应该能够找到 libaio.so.1