Mono seems to be able to be created using mingw, although most of the links I found are cross-compiled from Linux, for example. http://www.mono-project.com/Cross-compiling_Mono_for_Windows
I would say that your first priority is to look for the libmono library, which
- does not use cygwin (trust me)
- known to work, also outside of mingw (avoid possible mingw specific c ++ mangling if using c ++)
- Preferably comes with a readable header.
If you find or create it as a DLL (to satisfy mghie's correct remark) write a header (e.g. Stijn), it may work.
This will not be trivial, although virtual machines are not exactly trivial animals and expect problems in the usual areas of problems in different languages: library initialization (ordering), FPU exception mask and exception handling in general. In part, this also suggests that I know that βI know how to work outside of mingw,β exploring how it interacts with other compilers can give pointers how to handle this correctly.
Please note that the mono-tutorial has a mono lib initializer, but this does not mean that all libraries that use mono are correctly initialized. Specifically, mingw libc may need initialization, since they are usually initialized via ctors. My (very initial) mingw glue code is here:
http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/ide/fpmingw.pas?view=markup
On the other hand, in a DLL, it can be initialized using the DLL initialization procedure.
I myself was able to build GDB as a lib and use it (statically in FPC, although I had no motivation to create DLLs, since that was an option)
Please note: if you really need to do this yourself, this is NOT an easy way.
Marco van de voort
source share