I have created a sample c++ app that uses dynamic linking to embed mono (as described here http://www.mono-project.com/Embedding_Mono) and use C# for scripting. It works well, as long as mono is installed in the global assembly cache (GAC).
Is there a way to bundle mono with my c++ executable so that I can install it alongside my c++ executable ?
I have been looking at mkbundle but it looks like it packages mono with c# apps.
EDIT : answer below reformatted
#include <cstdlib>
_putenv("MONO_GAC_PREFIX=C:\\cygwin\\usr\\local\\bin\\");
mono_set_dirs("C:\\cygwin\\usr\\local\\lib","C:\\cygwin\\usr\\local\\etc");
EDIT :
Corrected : I just need to copy/paste mono-2.0.dll in the executable's folder and use
mono_set_dirs("C:\\cygwin\\usr\\local\\lib","C:\\cygwin\\usr\\local\\etc");
to force the use of a specific framework
Mono consists of 2 distinct parts:
Basically you need to provide your own GAC - this is easyily done by taking it with you into your app folder structure, then setting the MONO_GAC_PREFIX
environment variable to wherever you are installed.