[Mono-list] How to use shared library with C# on linux

Zonnet gkokmdam@zonnet.nl
Sat, 10 Jan 2004 17:06:56 +0100

Hi list,
I'm working on a .NET program that uses a shared library that is written
in C++. This shared library exports some C-functions like this:
extern "C"
    int MyLib_Test( const char* szcPath) {
       // some code
The output of nm libMyLib.so is like this (part of it):
    00004698 T MyLib_Test
Now I use this code in C# by using:
        private static extern int
MyLib_Test([MarshalAs(UnmanagedType.LPStr)] string strPath);

And I get a linker warning (when setting LD_DEBUG=libs) that it cannot
find the symbol MyLib_TestA... Anyone seen this behaviour?