[Mono-devel-list] Hello and DllImport problem...

Mongoose mongoose770 at yahoo.com
Sat Apr 30 20:22:24 EDT 2005

Hey, I'm new to the list.  I have a nice one for you
however!  =)

DllImport fails on this one certain library I have,
but works on libc, sister libraries, and generally
every other library I can find.  I'm referring to a
shared object (native, x86, ELF) on Linux 2.6 on
Debian Sid running mono 1.1.6.  

The only thing I can think of is the library provides
it's own extern "C" wrapper for it's C++ and uses a
lot of dlopen, manages other libraries, and has quite
a few dependencies.  Surely mono loads dependent
objects for the so to use!

Mono appears to load the so like all the others I've
tested. Including other C++ libraries, but using g++
symbols for invokation instead of C wrappers.  The
symbols I'm trying to bind are in the so, and aren't
bound at runtime either.  All the singletons needed
are allocated from that method I'm invoking.  Is there
a way to debug this better than using strace and nm? 
I just want to see how it fails to load the symbol
like in gdb I'm not picky.  Note this code has been
exported to several languages without a problem.  I
hope I've made some simple mistake.  =(

I can provide a link to source code for both the so
and the C# via the web and svn if requested.

/* Very simple you'd think */
[DllImport(libname, EntryPoint="freyjaSpawn")]
public extern static void run();

Unhandled Exception: System.DllNotFoundException:
in (wrapper managed-to-native) Freyja.LibFreyja:run ()
in <0x009b8> MainClass:Main (System.String[] args)

open("/usr/local/lib/libfreyja.so", O_RDONLY) = 10
512) = 512
fstat64(10, {st_mode=S_IFREG|0755, st_size=1711339,
...}) = 0
old_mmap(NULL, 347944, PROT_READ|PROT_EXEC,
MAP_PRIVATE, 10, 0) = 0xb6f9f000

http://icculus.org/freyja     | 3d Modeler
http://icculus.org/~mongoose  | Personal

Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

More information about the Mono-devel-list mailing list