Ich habe ein einfaches Testprogramm, das ich beim Ausführen bekomme:
./hello: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory
Ich verlinke es so:
$(CC) $(CCFLAGS) -o hello hello.o -L../ocilib-3.9.3/src/.libs -L../instantclient_11_2 -locilib
Mein LD_LIBRARY_PATH enthält folgendes:
LD_LIBRARY_PATH=../ocilib-3.9.3/src/.libs:../instantclient_11_2:/usr/lib
/ usr/lib sieht so aus:
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
Ausgabe von ldd hallo:
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
Ich hoffe, dass mir hier etwas einfaches fehlt. Das Oracle Instantclient-Paket scheint Libaio zu erfordern, aber das scheint bereits installiert zu sein.
Es sieht aus wie ein 32/64-Bit-Konflikt. Die Ausgabe von ldd zeigt, dass hauptsächlich Bibliotheken aus /lib64
ausgewählt werden. Dies würde bedeuten, dass Sie eine 64-Bit-Version des Oracle-Clients installiert und eine ausführbare 64-Bit-Datei erstellt haben. Aber libaio.so
ist wahrscheinlich eine 32-Bit-Bibliothek und kann nicht für Ihre Anwendung verwendet werden.
Sie benötigen entweder eine 64-Bit-Version von Libaio oder Sie erstellen eine 32-Bit-Version Ihrer Anwendung.
Geben Sie Folgendes ein:
Sudo apt-get install libaio1 libaio-dev
oder
Sudo yum install libaio
Ich hatte das gleiche Problem und es stellte sich heraus, dass ich die Bibliothek nicht installiert hatte.
dieser Link war super nützlich.
Ich musste folgendes tun (in Kubuntu 16.04.3):
Sudo apt-get install libaio1 libaio-dev
Sudo find / -iname 'libaio.a' -type f
-> ergab /usr/lib/x86_64-linux-gnu/libaio.a
export LD_LIBRARY_PATH="/usr/lib/Oracle/12.2/client64/lib:/usr/lib/x86_64-linux-gnu"
Ich habe ein ähnliches Problem.
Ich fand
conda installieren pyodbc
ist falsch!
wenn ich benutze
apt-get install python-pyodbc
Ich habe dieses Problem gelöst.
Für den Fall, dass man kein Sudo-Privileg hat, aber die Bibliothek trotzdem installieren muss.
Downloadquelle für die Software/Bibliothek mit:
apt-get source libaio
oder
wget https://src.fedoraproject.org/lookaside/pkgs/libaio/libaio-0.3.110.tar.gz/2a35602e43778383e2f4907a4ca39ab8/libaio-0.3.110.tar.gz
entpacken Sie die Bibliothek
Installieren Sie mit dem folgenden Befehl in die benutzerspezifische Bibliothek:
make prefix=`pwd`/usr install #(Copy from INSTALL file of libaio-0.3.110)
oder
make prefix=/path/to/your/lib/libaio install
Fügen Sie die libaio-Bibliothek für Ihre App in LD_LIBRARY_PATH ein:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/your/lib/libaio/lib
Jetzt sollte Ihre App libaio.so.1 finden können
Hier auf einer openSuse 12.3 installierte die Lösung zusätzlich die 32-Bit-Version von libaio. Oracle scheint das jetzt zu brauchen, obwohl es auf 12.1 ohne die 32-Bit-Version läuft.