[Mono-devel-list] shared library lookups

Paolo Molaro lupus at ximian.com
Thu Jul 17 12:47:02 EDT 2003


On 07/16/03 Alex Graveley wrote:
> So for many people without -devel versions of packages installed, mono
> doesn't find libraries like libgnome and libgnomevfs at pinvoke time.  
> 
> Perhaps mono should look for libtool versioned libraries (e.g.
> libfoo.so.1.2.3) if a .so can't be found?  In such a case I suppose mono
> would just look for the highest version available?

It would be fairly expensive to do a complete directory scan to find
the highest version (I have 2000+ files in /usr/lib, for example).
The solution is to use the dllmap mechanism in the mono config file,
adding an entry like:
	<dllmap dll="gnome" target="libgnome.so.32" />

(if "gnone" is the name used in the DllImport atribute).
Note: libgnome.so.32 doesn't include the minor library version, so that
you don't need to deal with changing the config file unless libgnome
changes in a backward-incompatible way: in that case the Gnome# code
would need to be changed as well anyway.

lupus

-- 
-----------------------------------------------------------------
lupus at debian.org                                     debian/rules
lupus at ximian.com                             Monkeys do it better



More information about the Mono-devel-list mailing list