This project is read-only.

C# Native

Compiling C#/MSIL to Native Code using C. (twitter)

You can support future development by donating!


Have a look at Babylon 3D (C# native port) to find out how to use C# native compiler to build a native OpenGL applications


Hello World

using System;

class X {
	public static int Main (string [] args)
		Console.WriteLine ("Hello, World!");
		return 0;

1) generating C file

Il2c.exe helloworld.cs /corelib:CoreLib.dll

it will produce a file helloworld.cpp

2) compile .exe file.

g++ -o helloworld.exe helloworld.cpp CoreLib.cpp -lstdc++ -lgcmt-lib -march=i686 -L .

NOTE: for single-threaded environment use library gc-lib instead of gcmt-lib

PS. To generate corelib.cpp
Il2c.exe /stubs CoreLib.dll

3) execute generated helloworld.exe

Long story short

Il2c.exe /exe helloworld.cs /corelib:CoreLib.dll /stubs

Last edited Nov 4, 2015 at 11:46 AM by AlexDev, version 47