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 < [email protected]> 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 - [email protected] > http://lists.ximian.com/mailman/listinfo/mono-list >
_______________________________________________ Mono-list maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-list
