I'm having trouble finding why this library (matio) isn't working for me. In my Makefile I have this:
LIBS += -L/home/brian/.../matio-1.5.6/src/.libs/ -lmatio
When I attempt to run my code (links fine) I get this error:
error while loading shared libraries: libmatio.so.4: cannot open shared object file: No such file or directory
libmatio.so.4 exists in the directory specified by the -L flag.
I built the library and it seems to go through make check
with only a handful writing errors (which is fine as I only need it for reading).
Things I've tried:
-l:libmatio.so.4.0.2
)LD_LIBRARY_PATH
/etc/ld.so.conf
and run sudo ldconfig
/etc/ld.so.conf.d
with the path and run sudo ldconfig
(When I run ldconfig -p | grep matio
nothing returns. Am I doing something wrong with ldconfig
?)
The error is actually telling you "no compatible library with that name exists in the library cache", not "no file with that filename exists on disk".
So, confusingly, this can happen when the shared object file is in the wrong format.
Ensure that it was built for the right platform by the right compiler! You can have a look with file
and verify that the dynamic link is failing using ldd
on your executable.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.