Frage

I have code that uses the DllImport attribute to talk with an unmanaged assembly. In OS X, this assembly is installed as a framework.

[DllImport("libraryname", CallingConvention = CallingConvention.Cdecl)]
public static extern void FunctionName();

However, this throws a DllNotFoundException in Mono, presumably because it has not been able to resolve the framework.

I looked in the Mono documentation: http://www.mono-project.com/Interop_with_Native_Libraries

They have this little nugget in there:

Mac OS X platforms have a lib prefix and a .dylib suffix, unless they're a Framework, in which case they're a directory and things get more complicated.

But they don't include any info (as far as I could find) about what I should do if it is a directory. Anyone has experience doing this?

Keine korrekte Lösung

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top