[Mono-devel-list] Issue of binary portability of a hello worl d application

Rafael Teixeira monoman at gmail.com
Sun Aug 8 13:02:17 EDT 2004


Many people think that C++ Managed Extensions is a pure Managed
(binary -portable) Language, in truth it doesn't generate a pure CLI
executable, it builds a mixed one that carries lots of runtime code
that is x86/Windows specific.

Use a pure Managed Language as C#, VB.NET, Nemerle, Boo, IronPython, etc.. 

Or try the new 2005 Express C++.NET, that finally is able to compile
to pure managed code.

Hope it clarifies it,

----- Original Message -----
From: Ioannis Vranos <ivr at grad.com>
Date: Sun, 08 Aug 2004 11:24:43 +0300
Subject: Re: [Mono-devel-list] Issue of binary portability of a hello worl
 d application
To: mono-devel-list <mono-devel-list at lists.ximian.com>

 Actually I did not use any managed C++ which also should be no
problem by itself, since does not use native code but is for CLI
things like
 
 
 // Reference type
 __gc class whatever
 {
  // ...
 };
 
 // Value type
 __value class whatever
 {
  // ...
 };
 
 
 These are pure CLI types. But probably the problem is the
mscorlib.dll. In what "dll" Console::WriteLine is included in Mono?
 
 
 
 
 
 
 Best regards,
 
 Ioannis Vranos
 
 
 
 Rob.Tillie at Student.tUL.EDU wrote: 
 
 

Hey Ioannis, 

  

Managed C++ is not supported on Mono, and thus it is not binary
compatible. As you can see in your error, it tries to invoke some C++
code using pinvoke.
 So, it always will be binary compatible, unless the language you use
uses pinvoke, like managed C++. (or you use it yourself).

  

Greetz, 

-- Rob. 

  
 
 
 ________________________________
 

From: Ioannis Vranos [mailto:ivr at grad.com] 
 Sent: Sunday, August 08, 2004 2:37 AM
 To: mono-devel-list
 Subject: [Mono-devel-list] Issue of binary portability of a hello
world application

  

Hello fellow developers. I just installed Mono the hard way in White
Box 3 Respin 1 GNU/Linux (a Red Hat variant) because I want to
experiment with binary portability between .NET and Mono.
 
 I created a simple CLI hello world  program with current C++ "Managed
Extensions" in VS 2003 and these are the contents of  the main .cpp
file:
 
 
 
 #include "stdafx.h"
 
 #using <mscorlib.dll>
 
 using namespace System;
 
 int _tmain()
 {
     Console::WriteLine(S"Hello World");
     return 0;
 }
 
 
 Well when I run the executable in GNU/Linux using mono Manage.exe I
get the error:
 
 
 ** ERROR **: file marshal.c: line 3096
(mono_marshal_get_native_wrapper): assertion failed:
(method->signature->pinvoke)
 aborting...
 Aborted
 
 
 
 Well it is obvious that an assert condition in Mono's code is
violated (why is it compiled in debug mode?). But why is it happening,
any ideas? (apart from the fact that assert failure indicates a bug if
it is used as it is supposed to).
 
 
 
 
 
 
 Best regards,
 
 Ioannis Vranos _______________________________________________
Mono-devel-list mailing list Mono-devel-list at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list
_______________________________________________ Mono-devel-list
mailing list Mono-devel-list at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list



-- 
Rafael "Monoman" Teixeira
---------------------------------------
Cognition is not a representation of an objectively existing world
but is a bringing forth of a world in the process of living.
-- Fritjof Capra, citing 
   Humberto Maturana and Francisco Varella's "Santiago Theory of Cognition"



More information about the Mono-devel-list mailing list