[Mono-list] Embedding mono on windows

Petit Eric surfzoid at gmail.com
Mon Mar 31 11:00:26 EDT 2008


2008/3/31, Damien DALY <maitredede at gmail.com>:
> Thanks Robert
>
> I'm also sending to list (sorry for missed messages, they are below).
>
> I will try to work with these functions.
>
> Now, I would like to call C function from my C#, and passing arguments to
> the function (like saying hello to string argument)...
http://www.google.fr/search?q=dllimport&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:fr:official&client=firefox-a
an Example in this file :
http://cs-obexftp.svn.sourceforge.net/viewvc/cs-obexftp/trunk/src/obexftp/obexftpPINVOKE.cs?revision=151&view=markup

If you are luky, try SWIG (under linux) to make the biggest work!

>
> Thanks,
>
> Damien
>
> 2008/3/31, Robert Jordan <robertj at gmx.net>:
> > Hi,
> >
> > Next time please reply to the list as well.
> >
> > Mono_set_defaults and mono_parse_default_optimizations
> are not public
> > anymore because they were not intended to be called from user code.
> > The runtime is calling them for you.
> >
> > On (2): mono depends on GLib, GNOME's portable C library. This lib
> > provides a lot of path functions:
> >
> >
> http://library.gnome.org/devel/glib/stable/glib-Miscellaneous-Utility-Functions.html
> >
> > See g_get_current_dir, g_build_path, etc.
> >
> > On Windows, mono's installer is deploying this lib automatically into
> > mono's lib folder. Just link your app with "glib-2.0.lib".
> >
> >
> > Robert
> >
> >
> >
> > Damien DALY wrote:
> > > Yeah, it works !
> > > Thanks...
> > >
> > > Two more questions :
> > >
> > > 1) I'd like to execute :
> > >     mono_config_parse(NULL); //To load default config
> > >     mono_set_defaults(0,
> mono_parse_default_optimizations(NULL)); //To add
> > > all optimizations
> > >
> > > mono_config_parse is defined in mono-config.h. I have a linker error
> > > "unresolved symbol"
> > > mono_set_defaults and mono_parse_default_optimizations
> are not defined...
> > >
> > > I'm using windows release with installer file "
> > > mono-1.9-gtksharp-2.10.4-win32-4"...
> > >
> > > 2) How can I find the directory of current module executing in C++ ?
> > > This is to tell mono that it must search assemblies in a sub folder of
> > > current exe... (mono_set_dirs)
> > > And if you have a safe concat function for path... (like managed
> > > Path.Combine)
> > > And that works for any OS... :o)
> > >
> > > Thanks
> > >
> > > Damien
> > >
> > >
> > > 2008/3/31, Robert Jordan <robertj at gmx.net>:
> > >> Damien DALY wrote:
> > >>> Hi,
> > >>>
> > >>> I'd like to embed Mono into my app, but I haven't found some doc
> > >> explaining
> > >>> how to do this using Windows and VS2008 (under XP and Vista).
> > >>> The starting point I have found is
> > >>> http://www.mono-project.com/Embedding_Mono
> > >>>
> > >>> If someone has help about Ebedded Mono under Windows, I would be
> pleased
> > >> to
> > >>> hear about.
> > >>
> > >> The docs apply to Windows/Visual Studio as well, but they don't explain
> > >> how to setup a project to the same extent like they do for linux or
> > >> cygwin.
> > >>
> > >> Basically, you only need to generate an import library for mono.dll,
> > >> the dll that provides the embedding APIs.
> > >>
> > >> Get this file:
> > >>
> > >>
> > >>
> http://anonsvn.mono-project.com/viewcvs/*checkout*/trunk/mono/msvc/mono.def
> > >>
> > >> and create mono.lib with Visual Studio's lib.exe tool:
> > >>
> > >>         lib /nologo /def:mono.def /out:mono.lib /machine:x86
> > >>
> > >> Then link you application with mono.lib.
> > >>
> > >> Robert
> > >>
> > >> _______________________________________________
> > >> Mono-list maillist  -  Mono-list at lists.ximian.com
> > >> http://lists.ximian.com/mailman/listinfo/mono-list
> > >>
> > >
> >
> >
>
>
> _______________________________________________
>  Mono-list maillist  -  Mono-list at lists.ximian.com
>  http://lists.ximian.com/mailman/listinfo/mono-list
>
>


More information about the Mono-list mailing list