[Mono-list] Running vs2005 beta 2 compiled code on mono...

Alex Mohr amohr at cs.wisc.edu
Fri Jul 1 13:54:38 EDT 2005

>Ususally the error message is the most important thing because it explains
>the error.:)

Heh yeah -- I know -- sorry again.  I didn't have the machines to run it
again and I didn't recall the exact message.

>You probably get the error message 'Method '%s' in assembly '%s' contains
>native code and mono can't run it. The assembly was probably created by
>Managed C++.'

No -- that's what I get if I try to run C++ code compiled with VS2003 on
the mac, and that's what I expect since there's no /clr:pure flag in

Instead I compile this program using /clr:pure on vs2005 beta 2 and try
to run it on the mac but I get this error:


int main()
    return 0;


% mono HelloWorld05b2.exe

** ERROR **: file object.c: line 752 (mono_class_create_runtime_vtable):
assertion failed: (fklass->byval_arg.type == MONO_TYPE_PTR)

>As the error message says Mono cannot run native code it can only run
>IL code. The reason is quite simple: Native code is processor and
>operating system dependent while IL code is platform independent.

Of course.  I understand all that.  I'm compiling /clr:pure so it's only
generating IL.

>C++ 2002 and 2003 cannot compile managed only code it allwasy contains some
>native code even if you do not call any native funtions nor CRT and use your
>own entry point to avoid CRT dependency. C++ 2005 is said to be able to
>compile IL only assemblies but I have never tried it.

Right, that's what /clr:pure does, except the resulting assembly
somewhat surprisingly doesn't run with mono on my mac.



More information about the Mono-list mailing list