Domanda

I'm calling lt_dlopen and getting a generic file not found error (translated errno text). How can I get more information about what is actually failing, as the file is definitely there.

This is a C++ program loading a C++ library. Otherwhere in the same program I use the same command to open other libraries without a problem, thus I fear it might be something specific to this library. I've used ldd and all those dependencies of the library are met.

È stato utile?

Soluzione

I stumbled across something that kind of works:

export LD_DEBUG=all

And then proceed to sift throught the extreme mass of output. In this case I found a "lookup error" and one of the symbols could not be resolved. I'm not sure why, but that is perhaps not relevant to this question.

Altri suggerimenti

Recompile libtool with "-DLT_DEBUG_LOADERS" in $CFLAGS. Adjust LD_LIBRARY_PATH so that your program will find this debug libltdl.so instead of the system one. That debug version of ltdl will print explicit errors for each loader's attempt to open the target with much less verbosity than LD_DEBUG=all.

From http://www.delorie.com/gnu/docs/libtool/libtool_46.html :

Function: lt_dlhandle lt_dlopen (const char *filename)

[...] If lt_dlopen fails for any reason, it returns NULL.

Function: const char * lt_dlerror (void)

Return a human readable string describing the most recent error that occurred from any of libltdl's functions. Return NULL if no errors have occurred since initialization or since it was last called.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top