[Mono-list] Unmanaged C++ library

Alan McGovern alan.mcgovern at gmail.com
Wed Nov 25 09:00:53 EST 2009


You should look into using SWIG to generate a C wrapper around your C++
library. Then you can just P/Invoke that.

Alan.

On Wed, Nov 25, 2009 at 1:09 PM, Alex Shulgin <
alexander.shulgin at yessoftware.com> wrote:

> Mario De Clippeleir wrote:
> > Hi,
> >
> > I was wondering about using a native unmanaged c++ library (DLL on
> windows and dylib on mac). How can i accomplish this ?
> >
> > After reading http://www.mono-project.com/Interop_with_Natiregister ECX.
> Other parameters are pushed onve_Libraries<http://www.mono-project.com/Interop_with_Native_Libraries>I still was kind of lost.
> > I cannot change the callingconvention to extern "C" and since it is quite
> a large library, using the DLlimport. entrypoint field seems like a huge
> task.
>
> Take a look at CallingConvention Enumeration here:
>
> http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.callingconvention.aspx
>
> > So after some more investigation, the only solution i can think of is to
> write a C++/CLI wrapper around the native C++ library, so that all methods
> and classes are available from within .NET.
> >
> > Is this really the only option ? Am i missing something ? Any better
> solutions ???
>
> No managed C++ won't work with Mono -- only with .Net.
>
> --
> Alex
>
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20091125/d7097df3/attachment.html 


More information about the Mono-list mailing list