Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Mono for developing in C++

I am starting to use Mono to develop applications in C# and C++. I wanted to ask you, how is Mono compiling the C++ code? is it using GCC? It is amazing to see that it has the STL containers... Also, can I use the Boost libraries and GSL libraries with Mono? Thanks in advance!!!

like image 233
user123668 Avatar asked Jul 17 '09 03:07

user123668


2 Answers

I think you must be using MonoDevelop, the IDE, as opposed to Mono itself.

Yes, MonoDevelop uses gcc/g++ to compile C/C++ source code, but it is not compiled to CIL - it is compiled to a native binary.

If I am understanding correctly, then you should be able to use boost just fine.

If, however, you are asking if Mono has support for Mixed-Mode assemblies or executables (e.g. assemblies/exe's that contain both native and .NET CIL), then I am sorry to inform you that this feature is not supported, nor is compiling C++ to pure CIL by Mono.

like image 174
jstedfast Avatar answered Nov 08 '22 23:11

jstedfast


As long as you don't need mixed mode (i.e., forget the native part and go for CIL-only), mono does work with C++ code (I hear they're now experimentally supporting mixed mode, on Windows especially, and elsewhere via wine, but I think that part's NOT ready for prime time). The one well-supported C++ compiler at this time is Microsoft C++/CLI on Net 2.x frameworks; efforts have been underway (for many years now) to add gcc, but I don't know of any production-ready result so far:-(.

like image 5
Alex Martelli Avatar answered Nov 08 '22 21:11

Alex Martelli