[Mono-list] [mono-list]DLL Import errors

Jeffrey Stedfast fejj at novell.com
Fri Apr 20 14:10:04 EDT 2007


On Wed, 2007-04-18 at 10:28 -0600, Eric Morgan wrote:
> 
> 
> >Frequently the problem is that the library is improperly linked; mono
> >(effectively) loads libraries using dlopen(3) with RTLD_NOW set, so
> if
> >your library depends on a symbol from another library but wasn't
> linked 
> >against that library, you will get errors loading it.
> >
> >You can also use http://www.jprl.com/dltest.c to test this scenario
> (see
> >the comments for compile commands). 
> >
> >If that still fails, you can reply to the mailing list with the Mono
> >output attached.
> >
> > - Jon
> >
> 
> Still fails, and the output is generally the same from when I was
> using MONO_LOG_LEVEL=debug.  Here's the output from dltest: 
> 
> [rengeo at localhost dltest]$
> ll /home/rengeo/RenegadeGeophysics/SeismicStudioLinux64/lib/
> total 992
> -r-xr-xr-x  1 rengeo rengeo 339956 Apr 17 10:14 libSentinelKeys32.a
> -r-xr-xr-x  1 rengeo rengeo 315468 Feb  8 14:42 libSentinelKeys32.so
> -r-xr-xr-x  1 rengeo rengeo 328388 Apr 17 12:26 libSentinelKeysJDK.so
> [rengeo at localhost
> dltest]$ ./dltest /home/rengeo/RenegadeGeophysics/SeismicStudioLinux64/lib/libSentinelKeys32.so
> error loading library
> `/home/rengeo/RenegadeGeophysics/SeismicStudioLinux64/lib/libSentinelKeys32.so': /home/rengeo/RenegadeGeophysics/SeismicStudioLinux64/lib/libSentinelKeys32.so: cannot open shared object file: No such file or directory 
> [rengeo at localhost dltest]$
> 
> 
> The library is clearly there, but both mono and this dltest is saying
> that it doesn't exist.  I've tried copying the library directly into
> the folder with dltest, and it still can't find it, even though is
> literally right there. 

Don't assume that it means that the file you gave it doesn't exist (I
know, it is the most reasonable assumption to make). I suspect that
Jonathan is correct, the problem is that your library depends on symbols
not found in either the application nor in the library you are trying to
load, and so dlopen() is failing - of course, this is just a guess :)

The only way to know for sure is to read the source code for dlopen()
and try to figure out what the problem is that way.

Jeff




More information about the Mono-list mailing list