Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Linux \ How to build Mono 3.4.0 / 3.4.1 on Windows     - Changes in C # asynchronous programming model (Programming)

- Linux Systemd-- To start / stop / restart services in RHEL / CentOS 7 (Linux)

- Ordinary users how the Linux system shutdown (Linux)

- Linux GCC 5.1.0 compiler installation (Linux)

- Analysis of potential problems through custom Orabbix monitoring Oracle (Database)

- Polymorphism of the C ++ compiler and run-time polymorphism (Programming)

- SecureCRT connect virtual machine Linux system (Ubuntu) (Linux)

- Graphing tool: Gnuplot (Linux)

- Using a proxy method under Linux terminal (Linux)

- CentOS 6.4 RPM install MySQL-5.6.22-1 (Database)

- Adjustment expand VMDK format VirtualBox disk space (Linux)

- Linux Task Scheduler (at, crontab) (Linux)

- How to create a cloud encrypted file system in Linux systems (Linux)

- CentOS 6.5 install Maven and Nexus warehouse agent (Server)

- Linux scp remote file copy (Linux)

- Regular expressions in Perl (Programming)

- PULL operation mechanism parsing XML Comments (Programming)

- Difference LVS three scheduling modes (Server)

- A summary of Java multi-threaded programming - acquaintance multithreading (Programming)

- VMware Workstation virtual machine startup error: Could not open / dev / vmmon in CentOS 6 (Linux)

  How to build Mono 3.4.0 / 3.4.1 on Windows
  Add Date : 2018-11-21      

This paper summarizes a lot of the existing articles and how to create Mono on Windows.

How are you looking compiled Mono 3.4.0 version, please visit here.

Mono project based tutorial can be found here.

In theory, these tutorials I have provided should be sufficient to allow you to successfully compile the Mono. However, in actual operation, it may be slightly more complicated. So other people also provided additional documentation, told us how to compile Mono. Among these, the "Building Mono on Windows: The Final Battle" "tutorial is particularly helpful.

Having said that, but these tutorials are already a lot of years ago, the use of the process will inevitably encounter problems, solve these problems, I offer the following detailed and complete tutorial.

We are from the current version (as I write this article, Mono release version is 3.4.0) to build, and then build the latest version of the code from the git repository.

The main steps are as follows:

Install pre-compiled Mono

Install & Configure Cygwin

Download and unzip the Mono source code

Construction Mono

Modify Cygwin / Mono to solve the problems in the build process

Installing Mono and modify the installation configuration

Xamarin Studio for some modifications and configuration

From the git download the source code and build Mono

This step tests are available in Windows 8.1 64-bit systems.

Mono installation compiled executable file

A stable and complete compilation of Mono 3.2.3 can be downloaded here. Download and install it.

Open a command line from Start bar, followed by what command to check whether it is operating properly with:

1 mono --version
You should see the following message appears, and determine which version is 3.2.3:

C: \ Program Files (x86) \ Mono-3.2.3> mono --version
Mono JIT compiler version 2.10.9 (tarball)
Copyright (C) 2002-2011 Novell, Inc, Xamarin, Inc and Contributors. Www.mono-pro
        TLS: normal
        SIGSEGV: normal
        Notification: Thread + polling
        Architecture: x86
        Disabled: none
        Misc: softdebug
        LLVM: supported, not enabled.
        GC: Included Boehm (with typed GC and Parallel Mark)
C: \ Program Files (x86) \ Mono-3.2.3>

Install Cygwin

Download and install the 32-bit Cygwin, which is a simulation of the Unix command-line tool in Windows, we use it to create Mono. Installation tutorial can be found here.

During installation, you will be prompted to choose to install the necessary packages. We needed to create a Mono package and not in the default installation settings, so we have to manually select them.

In Mono on Windows tutorial mentioned in many of the details about the package, these packages should be:

1 autoconf, automake, bison, gcc-core, gcc-g ++, mingw-gcc, libtool, make, python,
In the "Final Ba ttle instructions" he said referred to these packages:

1 gettext-devel, gettext, intltool, libiconv, pkg-config
In addition, we have the best package:

1 wget, zip patch, openssh, vim
Configuring Cygwin

Someone suggested to me by a list of mono-dev mailing, Cygwin should be able to configure "noacl" option to mount the disk drive system of the host system, otherwise, the file access time may be a problem. You can also click here to learn more here.

Open Cygwin, edit / etc / fstab file from the Start menu, and follow the following instructions:

1 # For a description of the file format, see the Users Guide
2 # http://cygwin.com/cygwin-ug-net/using.html#mount-table
3 # This is default anyway:
4 none / cygdrive cygdrive binary, posix = 0, user 0 0
The noacl option added to it, as follows:

1 # For a description of the file format, see the Users Guide
2 # http://cygwin.com/cygwin-ug-net/using.html#mount-table
3 # This is default anyway:
4 none / cygdrive cygdrive binary, noacl, posix = 0, user 0 0
You may need to turn off Cygwin and reopen it to make sure the changes to take effect earlier. You can run 'mount' command to look at 'noacl' whether the content at its output which, in order to check the configuration to take effect.

Get Mono distributions

As I write this article, the latest release of Mono is 3.4.0. Under Windows, yet this version of the installation package, the latest installation package is 3.2.3. We are here to build a binary package version 3.4.0.

Mono 3.4.0 you can download the source code from here and unzip it to your disk.

You need to use Cygwin to download and extract the source. You can also do these things in Cygwin outside, but if you are not careful, you may find the code line breaks (CRLF) is modified out, this is likely to cause the build to fail.

So, open Cygwin terminal command line:

1 $ cd / cygdrive / c $ mkdir monosources $ cd monosources $ wget http://download.mono-project.com/sources/mono/mono-3.4.0.tar.bz2
2 $ tar xjvf mono-3.4.0.tar.bz2
Built from Mono release compressed package

When constructing Mono may be some errors, such as missing files, and header files conflict Cygwin or the like. If an error occurs, we can follow the instructions to correct any errors, but we need to do now is to start building Mono, see if we can go a step further.

We give Mono 3.4.0 specify a destination folder, and we will take it up as the installation directory. As follows:

1 $ cd / cygdrive / c
2 $ mkdir monoinstall
3 $ cd monosources / mono-3.4.0
$ 4 ./autogen.sh --prefix = "C: \ monoinstall" --with-preview = yes
Note: We give --prefix specifies the Win32 path specified format, rather than * nix or Cygwin path format.

Autogen be successfully completed, then we will build configuration commands, such as the autogen recommend it:

1 $ ./configure --host = i686-pc-mingw32
When the end of the configuration process, we can see some of the output of the following types:

01 mcs source: mcs
03 Engine:
04 GC: sgen and bundled Boehm GC with typed GC and parallel mark
05 TLS: pthread
07 Engine: Building and using the JIT
08 oprofile: no
09 BigArrays: no
10 DTrace: no
11 LLVM Back End: no (dynamically loaded: no)
13 Libraries:
14 .NET 2.0 / 3.5: yes
15 .NET 4.0: yes
16 .NET 4.5: yes
17 MonoDroid: no
18 MonoTouch: no
19 Xamarin.Mac: no
20 JNI support: no
21 libgdiplus: assumed to be installed
22 zlib:
Once the configuration is over, we can use the following way to start the build process.

1 $ make

Installation failed # 1 - PEXECUTION_STATE

The first installation is due to the failure of the same name and PEXECUTION_STATE Cygwin variables defined in the Mono defined conflict. Specific error message similar to the following output:

01 /usr/i686-pc-mingw32/sys-root/mingw/include/ddk/ntapi.h:49:15:
02 error: conflicting types for & apos; PEXECUTION_STATE & apos;
03 In file included from
04 /usr/i686-pc-mingw32/sys-root/mingw/include/windows.h:62:0,
05 from
06 /usr/i686-pc-mingw32/sys-root/mingw/include/winsock2.h:40,
07 from ../../mono/io-layer/io-layer.h:24,
08 from ../../mono/metadata/domain-internals.h:15,
09 from ../../mono/metadata/metadata-internals.h:8,
10 from ../../mono/metadata/class-internals.h:10,
11 from ../../mono/metadata/object-internals.h:8,
12 from process.c: 16:

The recommended approach is to modify the Cygwin header files in Cygwin can modify the definition PEXECUTION_STATE by the following method:

1 $ nano /usr/i686-pc-mingw32/sys-root/mingw/include/ddk/ntapi.h

The following:

1 / * FIXME: Unknown definitions * /
4 typedef PVOID PLANGID;

change into:

1 / * FIXME: Unknown definitions * /
4 typedef PVOID PLANGID;

You can now restart the compilation process

1 $ make

Construction Mono installation file

Wait until the successful conclusion of the compiler, you can install it to the specified directory.

First, mount the destination folder Cygwin as follows:

1 $ mount "C: \ monoinstall" / usr / local

Note: I found that if you mount before compiling the destination folder, and will get a libiconv-related errors. This may be 'noacl' relationship, so I suggest that you wait until compile successfully completed and ready to go when installed mount the destination folder.

Installation failed # 2 - Missing the target file

There is a missing file should be present in Mono 3.4.0 release tar package. For more information, see here.

You need to create this file manually and then add this file.

1 $ nano mcs / tools / xbuild / targets / Microsoft.Portable.Common.targets
This file must contain the following

1 < Project xmlns = < a class = "moz-txt-link-rfc2396E" href = "http://schemas.microsoft.com/developer/msbuild/2003"> "http://schemas.microsoft.com/developer / msbuild / 2003 ">
2 < Import Project = ".. \ Microsoft.Portable.Core.props" />
3 < Import Project = ".. \ Microsoft.Portable.Core.targets" />
4 < / Project>
Install this file

1 $ make install
Fixed: Installation Issues - mono.exe

For some reason, the installation executable file mon.exe not be copied to win32 folder.

This seems to be a reserved function, it can be copied by the current Mono installed,


1 copy C: \ Program Files (x86) \ Mono-3.2.3 \ bin \ mono.exe to C: \ monoinstall \ bin
With this fix, you can then execute windows under Mono, and check your correct version. Open a Windows command box, type

1 cd c: \ monoinstall \ bin
2 mono --version
You should see something like the following results

01 Mono JIT compiler version 3.4.0 (tarball)
02 Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. Www.mono-project.com
03 TLS: normal
04 SIGSEGV: normal
05 Notification: Thread + polling
06 Architecture: x86
07 Disabled: none
08 Misc: softdebug
09 LLVM: supported, not enabled.
10 GC: sgen
Correction: Xamarin Studio- prevent unrelated symbolic links runtime

If you attempt Xamarin Studio's Tools-> Options, Projects -.> NET Runtime add Mono 3.4.0 runtime, it will fail and an error message pops up "Mono runtime not found".

This is because the extra symbolic link files are copied during installation.

You may not want to see them in the Explorer or the command box dir command, although dir / a should show it.

If you remove these difficulties under Windows, you can use the Cygwin terminal and type the following command

1 cd / cygdrive / monoinstall / bin
2 $ rm mono
Now you can add runtime to Xamarin Studio.

Workspace: Building project issues at Xamarin Studio

(1) Xamarin Studio Mono 3.x use to build the project will fail, an error message is compilation fails, it failed to find "System.Globalization.SortVersion" type. This problem has been added to the feedback and will not appear on the 3.4.0.

Suitable for older versions Xamarin Studio workspace Click here to participate in the discussion.

For example, use your account Xamarin.com view all version in the download Xamarin Studio 4.2.3.

(2) You may then get a compile error on the UNC paths.

error: Error building target GetReferenceAssemblyPaths: UNC paths should be of the form \\ server \ share

Appears with the profile of this case additional \\ 's, please click here to participate in the discussion.

The solution is to remove the workspace project options "Use MSBuild engine", then you can compile and debug programs.

Construction Mono project on git repository

Time series code is similar to the build 3.4.0 release tarball. Over time, the existing version will be marked, the new version will continue to produce, so my suggestion is that you start to use the same git hash throughout the project to compare documents, verify the compiled version (3.4.1 ) and check our major version again.

The above mentioned and described in detail, you will need to install a Cygwin packages, and modify PEXECUTION_STATE.

Open Cygwin terminal and type the following command

1 $ cd / cygdrive / c / monosources
$ 2 git clone git: //github.com/mono/mono.git
We will verify 079c2e126f594c5a338a779c72a899951de38960 git together.

You can also choose to verify this

1 $ cd mono
2 $ git checkout 079c2e126f594c5a338a779c72a899951de38960
Ensure that / usr / local is not mounted, or you'll get a libiconv-related compilation failed.

1 $ umount / usr / local
Then set and start the compilation

1 $ ./autogen.sh --prefix = "C: \ monoinstall" --with-preview = yes
2 $ ./configure --host = i686-pc-mingw32
3 $ make
After compiling you need to mount the / usr / local, Setup, add and remove mono.exe symbolic link mentioned above

1 $ mount "C: \ monoinstall" / usr / local
2 $ make install
$ 3 cd / cygdrive / c / monoinstall / bin
4 $ rm mono
5 $ cp / cygdrive / c / Program Files (x86) /Mono-3.2.3/bin/mono.exe / cygdrive / c / monoinstall / bin
Then you already have the latest and the best Mono programs run! You can open a cmd window and type

1 C: \> cd c: \ monoinstall \ bin
2 C: \ monoinstall \ bin> mono --version
You may now expect major version with Cygwin terminal check git and compiling the latest Mono source.

1 $ cd / cygdrive / c / monosources / mono
2 $ git checkout master
- Linux processes in memory and memory cgroup statistics (Linux)
- Linux system security configuration (Linux)
- How to enable curl command HTTP2 support (Linux)
- How to turn Java String into Date (Programming)
- Ten linux version of the system (Linux)
- Python programming style (Programming)
- Debian 8.1 (amd64) deployed Memcached (Server)
- Snapshot DataGuard (Database)
- CentOS / Linux SELinux Close (Linux)
- Installation image conversion tool on your Ubuntu Converseen 0.8.1 (Linux)
- Android Studio Clear Project or Rebuild Project Error (Linux)
- pdf.js Tutorial (Linux)
- How to become a better Node.js developers in 2016 (Programming)
- CentOS 6.6 shortcut command execution (Linux)
- After you change the GRUB boot disk partition repair (Linux)
- Use mysqldump backup performed MariaDB (Database)
- CoreOS use register mirror to build private warehouse (Linux)
- Weld a problem in JDK 8u60 environment (Programming)
- C ++ function object (Programming)
- Using Libreoffice under ubuntu (Linux)
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.