[Mono-list] Managed C++ assemblies and Mono

Patrick Hartling patrick@vrac.iastate.edu
Wed, 08 Jan 2003 10:27:24 -0600

Recently, I have been experimenting with .NET as a potential way to 
implement my Ph.D. research.  My goal is to make a collection of native 
C++ libraries available to .NET languages by wrapping the native code in 
Managed C++.  Using Visual Studio, I have gotten to a point where I have 
an assembly that I can use to write C# code, and that C# code can 
interact with the native C++ libraries (much to my extreme joy). 
However, when I brought the assembly and C# code over to Linux, the Mono 
0.17 runtime choked on what I think is the first access to the native C++ 
code in the assembly (*).

In trying to figure out if I was doing anything wrong, I was looking 
through the archives of this list.  I came across some information that 
led me to believe that the assembly compiled from Managed C++ is not 100% 
IL code--rather, it contains some native (i.e., Win32) calls.  Is that in 
fact the case?  I'd like to know for sure if it's even possible to make 
this work before I try digging into it any further.

Basically, I would prefer to do my research using Linux and other 
UNIX-based platforms where Mono is available rather than trying to learn 
the ins and outs of Windows programming just so I can finish my work.  Of 
course, if I go the .NET route, I expect that most of my coding will be 
in C#, so it may not matter much what development environment I use.


(*) I'm probably making a big assumption that the assembly has some magic 
symbol management that allows a symbol in a native library to be found 
regardless of the compiler used to generate it.  Certainly, this has not 
been the case with C++ historically, so it may be that my hopes are too 
high for newer technology.

Patrick L. Hartling                     | Research Assistant, VRAC
patrick@vrac.iastate.edu                | 2624 Howe Hall: 1.515.294.4916
http://www.137.org/patrick/             | http://www.vrac.iastate.edu/