Does Mono .NET support and compile C++ / CLI?
If not, do you know if they have any plans of supporting it?
. 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 .
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.
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.
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.
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:
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#?)
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#.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With