ldd says not found even though library is in my LD_LIBRARY_PATH
The problem was a 32-bit/64-bit collision:
$ file libpmsfdcwrt.so
libpmsfdcwrt.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, not stripped
$ file /lib64/libz.so.1.2.3
/lib64/libz.so.1.2.3: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, stripped
Thank you, everyone, for pointing me in the correct direction.
ldd can't find library in LD_LIBRARY_PATH
The binaries I had were looking for the 32-bit versions of the shared libraries, I had the 64-bit installed. Stupid mistake. LDD didn't produce a very insightful error message, but the binary did when I tried to run it.
ldd says library isn't found by compile completes successfully
The library files are shared objects, which means that they will not be resolved until run time. In order for ldd to find them (assuming Linux or other Unix variant) you will need to add the path the libraries to your LD_LIBRARY_PATH (there is another path env that can be used but I can't think of it right now) and then ldd should be able to find the library.
ldd shows library not found for shared library dependency
I finally came across this question in which the answer provided by @schily worked for me.
QLibrary::load fails, but LD_LIBRARY_PATH just updated correctly before that, why?
The problem is that you change the environment variable LD_LIBRARY_PATH
from within the process. However the process still uses the "old" environment variables block with old values. As a result it cannot properly find the dependent libraries and eventually fails.
Therefore your approach will not work. I would propose the following solutions:
- Set the
LD_LIBRARY_PATH
variable before starting the process, so that the process can take the updated block into account, - Try to use
QCoreApplication::setLibraryPaths()
function to set the library search paths.
Related Topics
What Is Export_Symbol_Gpl in Linux Kernel Code
D-Bus Tutorial in C to Communicate with Wpa_Supplicant
How to Erase Printed Characters in a Console Application(Linux)
Evaluating Smi (System Management Interrupt) Latency on Linux-Centos/Intel MAChine
Compiling Out-Of-Tree Kernel Module Against Any Kernel Source Tree on the Filesystem
Binary Data Over Serial Terminal
Replace a Text with a Variable
How to Install Influxdb in Windows
Docker Copy with File Globbing
Docker MACvlan Network, Unable to Access Internet
Sftp on Linux Server Gives Error "Received Message Too Long"
How to Write One Script That Runs in Bash/Shell and Powershell
Why Doesn't "History | Vim" Work