[Mono-list] Problems in PInvoke. Getting DllNotFoundException.

Ahmed S K Anis aanis at novell.com
Fri Aug 5 06:34:39 EDT 2005


Hi,
I have a C# program from which I make PInvoke calls to a native library
(.SO).
The Native Library is written in C++, but i exposed few interfaces as
extern "C" and  I call only them in my C# sample.

I get a DLLNotFoundException. The Debug info says "Unable to find
symbol xyz...."
The symbol is actually a member variable of a C++ template class. My C#
program does not invoke any method in the library which requires this
symbol!!
Why is that the i get a DllNotFoundException, unable to find Symbol
xyz.....? Juts a note that debug message shows a mangled symbol.

I expected the .SO to get loaded cause the methods I invoked from my C#
is resoved and i dont call any another method which needs these
undefined symbols.  Infact the same .SO works fine from a C program but
it fails when i try from C#.

Is it that mono tries to resolves all symbols at DLLIMPORT load time ?

Some thoughts or pointers would be of great Help.

Thanks and Regards
Anis















More information about the Mono-list mailing list