[Mono-list] existing managed C++-libraries for Mono and whats with csgl?

Jonathan Pryor jonpryor@vt.edu
30 Jul 2002 16:12:33 -0400


You're wrong.  Your third example (mixed cout/Console.WriteLine) should
compile.  It is this property which makes MC++ useful for bridging
native C++ libraries and .NET libraries (which I've done before).

Additionally, the first example (Console.WriteLine) will have native
code in it.

For fun, run ildasm on the resulting executable of the first one.  One
of the symbols (IIRC) should be _mainCRT (or something similar), which
looks like it calls into the MSVC native libraries.

Last I knew, it was *impossible* to use MC++ to create a "pure" .NET
program.

 - Jon

On Tue, 2002-07-30 at 15:06, Freddy BL wrote:
> >Managed C++ libraries aren't very portable at all. The compiler
> >generates x86 code for some parts.
> 
> No. I think, thats wrong.
> The problem is, that the MS-C++.net-compiler are two different compilers.
> 
> For example:
> If you write
> 
> #include <iostream>
> using namespace std;
> 
> void main() {
> cout << "Hello World";
> }
> 
> it creates native-code.
> 
> But if you write
> 
> #using <mscorlib.dll>
> #using <System.dll>
> 
> void main() {
>    Console::WriteLine("HelloWorld");
> }
> 
> it creates .net-code.  (I hope the example is correct. I don't have tested 
> the example-code at the moment).
> 
> 
> But I think - and you can test it yourself - that a mixed one is not 
> possible. Somethink like
> 
> #include <iostream.h>
> using namespace std;
> 
> #using <mscorlib.dll>
> #using <System.dll>
> 
> vid main() {
>   cout << "in native";
>   Console::WriteLine("and in .net");
> }
> 
> can't be compiled.
> So, for Mono only the .net-C++-compiler is important. The other one is like 
> the g++.
> 
> But it is possible, to rewrite all native-C++-Libraries for .net, too, so 
> that it can be used in managed C++, too. But Microsoft haven't done it.
> 
> 
> Greatings
> Freddy BL
> 
> 
> _________________________________________________________________
> Testen Sie MSN Messenger für Ihren Online-Chat mit Freunden: 
> http://messenger.msn.de
> 
> 
> _______________________________________________
> Mono-list maillist  -  Mono-list@ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list