[Mono-osx] P/invoke 32-bit C library

Uli Hertlein uli at xdt.com.au
Thu Sep 15 03:30:31 EDT 2011

Hi Andrew,

On 09/14/2011 06:22 PM, Andrew Ayre wrote:
> On 9/14/2011 3:41 PM, Uli Hertlein wrote:
>> Try dropping the leading '_' in the DllImport.
>> I'm doing exactly the same and don't specify the leading underscore in
>> the DllImport statement and it's fine.  (I guess some layer along the
>> way adds it automatically?)
>> And yes, my symbols also have it in the dylib.
> Hi Uli,
> Yes, that did the trick! However I went back and tried it again in
> Windows and it's wanting the underscore, which is a bit puzzling. For
> now I will have two separate C# wrapper assemblies but I will have to
> revisit this to understand it better later and hopefully get back to a
> single wrapper assembly.

Good to hear this works.  I'm puzzled why it's behaving differently on Windows, it shouldn't do that.

I'm using the same C# DllImport statement for all platforms - VS2010 with .NET on Windows, and gcc 
with Mono on Linux and OS X.


Ulrich Hertlein
Research and Development   mailto:uli at xdt.com.au
XDT Pty Ltd                http://www.xdt.com.au

More information about the Mono-osx mailing list