I have a library built using libtool which is install into the package's library directory, /usr/local/lib/myprog/libmylib.so
. I'm dynamically loading the library in my code with libltdl. When I try to load this library on one machine, it works just fine. On another, with the same build and the library installed on the same location, I get a "file not found" error.
If I call lt_dlforeachfile
directly before lt_dlopenext
(which I use to load the library), then I can see by printing out filenames that the library I need has been found in the search path. But then immediately after, loading it fails with a "file not found" error. Any suggestions?
UPDATE
I have tried switching to using dlopen
and explicitly specifying the absolute path to the library. This still works on some systems and not on the other.