[Mono-list] mono and shared libs

The Source peter.bauwens@pandora.be
Tue, 28 Oct 2003 21:46:11 +0100


I'm rather new at using mono and i have some trouble using the DllImport
statement to link to shared libs.

After I got a sample from mono-doc containing the following lines

[DllImport("ncurses", EntryPoint="initscr")]
public extern static void initscr();

i tried to do the same to the zvt lib (libzvt.so) which resides in the
same place as the libncurses.so file does. When runnning my app however,
mono can find and use the libncurses file without any problem but keeps 
on nagging about being unable to locate the libzvt.so file.

[DllImport("zvt", EntryPoint="zvt_term_new")]
public static extern IntPtr zvt_term_new();

Both shared libraries reside in the /usr/lib directory, why is mono
unable to find the latter if it has no problem with the first?

How do i fix this?

Thx in advance


1. I tried configuring the mapping of zvt to libzvt.so in  the
/etc/mono/config file without any progress, mono always tries to find
the shared lib in ./ copying the lib to ./ seems to help for the shared
lib itself but then loading the libs it depends on fails

2. ldd results for both libs

# ldd libncurses.so
  libc.so.6 => /lib/tls/libc.so.6 (0x42000000)
  /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)

# ldd libzvt.so
  libz.so.1 => /usr/lib/libz.so.1 (0x40027000)
  libm.so.6 => /lib/tls/libm.so.6 (0x40035000)
  libc.so.6 => /lib/tls/libc.so.6 (0x42000000)
  /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)