Create, compile, and execute a Linux operating system

Source: Internet
Author: User

I would like to recommend a Linux operating system that is very useful to everyone, for example, to let everyone know about the Linux operating system, and then to give a comprehensive introduction to the Linux operating system, we hope to use MONO in Linux to execute the C # program.

Step 1 environment (in UBUNTU) sudo apt-get install mono-gmcs mono

Step 2: Create example. csclass X {static void Main () {System. Console. Write ("My first mono app worked! "N ");}}

Step 3 compile gmcs example. cs

Step 4. /example.exe uses C # in Linux (under the Fedora System) When Microsoft starts it. NET strategy, one of the goals is to make the software run on a variety of different platforms. Mono, an open-source project that enables. NET to run on your Linux operating system.

In Linux, if you are like me, working with Microsoft and Linux, Mono will help you, you can write C # programs on both platforms. Download the latest Mono installation package from the www.go-mono.com. I read it. When I wrote this article, Mono 1.1.13.8 was the latest Stable version on the official website.

Before installing Mono, you must determine whether you have GIMP Toolkit, Drawing Kit, and pkg-config. You can download them on rpmfind.net. We recommend that you download the latest version. If you have the software on your Linux operating system, you may need to upgrade it.

Install the software below:
# Rpm-Uvh glib2-2.0.0-1.i386.rpm
# Rpm-Uvh glib2-devel-2.0.0-1.i386.rpm
# Rpm-Uvh pkgconfig-0.12.0-1.i386.rpm

Next, extract Mono:
# Tar-zxvf mono-1.1.13.8.tar.gz

Next:
#./Configure
# Make
# Make install

After all the preceding operations are completed, your Linux operating system has a working Mono, which includes the C # compiler of Mono, mono instant compiler and mint (The Mono interpreter ). Now you can write C # program. For example, hey, write the most famous Hellow World Program:

Class Hello {
Static void Main (){
System. Console. WriteLine ("Hello World ");}}

Haha, it is really a classic. C # the program must be suffixed with. cs. Enter the program and save it. For example, save it as HelloWorld. cs and compile it:

# Mcs Hello. cs

If you write all programs, this command will generate a MSIL file named helloworld.exe, and then you can use this file:
# Mint HelloWorld.exe
Hello World

Mint interprter has many optional commands, including -- trace and -- debug, which are useful for debugging. When your program has been completed, you can compile it on the JIT compiler:
# Mono HelloWorld.exe
Hello World

The public Language Runtime Library provides cross-platform capabilities .. . NET program can run on any system with CLR installed. In fact, the C # compiler of Mono is compiled on the Windows platform using the Microsoft. NET Framework SDK and then moved to the Linux platform. You can transfer the compiled program on Windows to the Linux operating system and run it.

Mono has not fully implemented the. NET Framework, but it is enough for you to run the program you want to write. In Linux, open-source things generally evolve fast, and may quickly meet your needs.

Linux operating system by the way, there is a Gtk # project on the gtk-sharp.sourceforge.net, it is committed to C # language binding gtk + toolkit. It is also designed to provide libraries compatible with Windows. Forms under Mono. Of course, it is difficult to migrate from Windows to Linux. Let's keep an eye on its progress.

  1. The development status and trend of Linux operating system in various fields
  2. CentOS VM supports RedHat AS3/AS4/AS5Linux Operating System
  3. Integration notes: Linux operating system apache and resin
  4. Detailed analysis of Linux operating system PS commands
  5. Describes how to enter and exit a Linux operating system

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.