Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Mono .NET support and compile C++ / CLI?

Tags:

.net

mono

c++-cli

Does Mono .NET support and compile C++ / CLI?

If not, do you know if they have any plans of supporting it?

like image 647
Brian R. Bondy Avatar asked Oct 08 '08 15:10

Brian R. Bondy


People also ask

Can Mono run .NET framework?

. NET 5 provides two options of runtimes for users: the high-performance CoreCLR (for server and desktop applications), and the lightweight Mono (for mobile and WebAssembly). Mono still supports the . NET Framework compatibility mode, and it can be used with all of Microsoft's .

What is Mono C++?

In this article we will explain the basic concepts you should know if you want to embed the Mono runtime into your C++ application. Mono is a . NET based open source platform with a very useful CSharp compiler that we use to compile our scripts.

What version of C# does Mono use?

The Mono C# compiler is considered feature complete for C# 1.0, C# 2.0, C# 3.0, C# 4.0, C# 5.0 and C# 6.0 (ECMA) and it has partial support for C# 7.

What is Mono command?

The mono command executes a compiled Mono program in the virtual machine. mono uses a just-in-time compiler (JIT) to translate the compiled CIL bytecode to machine code for execution. The Hello.exe program can be run with mono Hello.exe.


1 Answers

We don't have a compiler for C++/CLI, it would be a very large undertaking for a very small userbase. Consider also that the C++/CLI spec is inherently flawed and non-portable, so being able to compile it wouldn't help much in the general case.

You can compile using the MS .NET compiler and run in mono with these restrictions:

  1. run with mono on any system if the C++/CLI app is pure managed (but then, why use such an ugly language and not C#?)

  2. run with mono on windows in the other cases (C++/CLI apps are in general non-portable and include native code, so they can run only on windows and are uninteresting for the major objective of mono which is to run managed programs on Linux)

Note that MS itself will eventually drop C++/CLI, so don't invest too much on it and switch to C#.

like image 83
lupus Avatar answered Sep 23 '22 12:09

lupus