cannot open shared object file: No such file or directory
-
SOLVED
The library needs to be aided to BOTH main project and sub project where it is used.
The error indicated which project is missing the access to the library
10:15:34: Starting /media/nov25-1/RAID_md125/MDI_DEC20_BACKUP/DIRECT_BACKUP_DEC20_BASE_V1/Qt-5.15.2/widgets/mainwindows/mdi/mdi... /media/nov25-1/RAID_md125/MDI_DEC20_BACKUP/DIRECT_BACKUP_DEC20_BASE_V1/Qt-5.15.2/widgets/mainwindows/mdi/mdi: error while loading shared libraries: libBluetooth_Connect_Library.so.1: cannot open shared object file: No such file or directory 10:15:34: /media/nov25-1/RAID_md125/MDI_DEC20_BACKUP/DIRECT_BACKUP_DEC20_BASE_V1/Qt-5.15.2/widgets**/mainwindows/mdi/mdi** exited with code 127
-
You will find that, on Linux machines, there are generally three file entries related an any library. Two of these are symlinks to the other, which is the library binary. These symlinks allow users of the library a way to specify the degree of compatibility they require.
chrisw@newton:~$ ls -l ~/Qt/6.4.0/gcc_64/lib/libQt6Core.so* lrwxrwxrwx 1 chrisw chrisw 15 Sep 27 17:04 /home/chrisw/Qt/6.4.0/gcc_64/lib/libQt6Core.so -> libQt6Core.so.6 lrwxrwxrwx 1 chrisw chrisw 19 Sep 27 17:04 /home/chrisw/Qt/6.4.0/gcc_64/lib/libQt6Core.so.6 -> libQt6Core.so.6.4.0 -rwxr-xr-x 1 chrisw chrisw 6786160 Sep 22 19:12 /home/chrisw/Qt/6.4.0/gcc_64/lib/libQt6Core.so.6.4.0
The symlinks may exist from a previous build/install even if the actual file is removed in a
make clean
operation or fails to build.As for the runtime error: Your attempt to run a program called
mdi
, that wants to dynamically loadlibbtchat.so.1
fails because that library file is not present in the locations the dynamic loader looks. That is generally the same directory as the executable, on a system path (LD_LIBRARY_PATH), or on a path embedded into the executable (DT_RUNPATH and DT_RPATH). The ldd program can tell you what libraries an executable is linked to and where they were found (or not found as in this case). -
@ChrisW67 said in cannot open shared object file: No such file or directory:
You will find that, on Linux machines, there are generally three file entries related an any library.
and if they meet my standard of sophistication then there will be a forth: libname.a for static linking.
-
@AnneRanch said in cannot open shared object file: No such file or directory:
/media/q6/MDI_BASE_RAID_5/DIRECT_BACKUP_DEC14_/Qt-5.15.2
/media/q6/MDI_BASE_RAID_5/DIRECT_BACKUP_DEC14_/Qt-5.15.2
here qt6 dir <==> with Qt-5.15.2?