[Mono-list] Embeding mono. Error at mono_jit_exec

Robert Jordan robertj at gmx.net
Mon Nov 23 16:52:41 EST 2009


Alexander Smirnov wrote:
> Hello.
> 
> I'm trying to embed mono into a C application and I get an error when executing the compiled C code
> 
> (process:3817): GLib-CRITICAL **: g_path_is_absolute: assertion `file_name != NULL' failed
> 
> when executing mono_jit_exec() function
> 
> here is the C code:

> 	domain = mono_jit_init (file_name);		
> 	mono_config_parse(NULL);
> 	assembly = mono_domain_assembly_open (domain, file_name);
> 	printf("assembly=%d\n",(int)assembly);
> 	mono_set_dirs(NULL, NULL);
> 
> 	mono_jit_exec (domain, assembly, argc-1, argv+1);

argc-1 and argv+1 are probably invalid, as mono_jit_exec expects
the assembly file name in argv[0].

It should work you invoke the native app like this:

./foo ./empty.exe

In this case (argc - 1) will be 1 and argv [0] will be "./empty.exe".

Robert



More information about the Mono-list mailing list