[Mono-list] GLib Critical Error at attemting to embed Mono (and other minor troubles).

Lucyberad Lucyberad at gmail.com
Sat Aug 22 09:21:03 EDT 2009


Hi,

I've some trouble at embedding Mono inside a C++ app.

I got an assertion error on mono_jit_exec. The console output an error from
Glib:
http://www.nabble.com/file/p25093790/visual_mono_glib_asssertion_error.png 
(right-click: show image to view it fullsize)

More than this errors, I had many troubles at embeding Mono.
The first is about linking to a library: mono_domain_assembly_open(domain,
file) don't work if the mscorlib.dll library file is not located to
"../lib/mono/1.0/mscorlib.dll" (relative to the main exe). I made a copy of
this dll to the path but I don't know how to put it on the same folder than
the exe (or use this dll as static). In fact, I don't really know what to do
with this dll. If my memory is good, it's the main dll of .NET langage.
The second is about understanding why compiler can't recognize
mono_config_parse() but I finally found it in mono-config.h (which is not
shown 
http://anonsvn.mono-project.com/viewvc/trunk/mono/samples/embed/teste.c?&view=markup
in sample ). 
The third is why is mscorlib.dll in "mono/1.0/". Does it means I try to
embed Mono1.0 instead of 2.0 (or 2.4)?
The last is why the path of my file must be absolute and not relative? If I
do relative, the assembly var is = 0. Can't I just call with
"helloworld.exe" (or "./helloworld.exe")?


helloworld.exe is this code:

using System;
namespace Lucy.Mono.Examples
{
    public class HelloWorld
    {
        public static void Main(string[] args)
        {
            Console.WriteLine("Hello World");
        }
    }
}

compiled with MCS and execute well (either Mono and MS.Net).

I'm using the latest actual release which is 2.4.2.3.


Thanks for spending time to help me (and made mono a nice project).
Lucyberad.
-- 
View this message in context: http://www.nabble.com/GLib-Critical-Error-at-attemting-to-embed-Mono-%28and-other-minor-troubles%29.-tp25093790p25093790.html
Sent from the Mono - General mailing list archive at Nabble.com.



More information about the Mono-list mailing list