Monodevelop 4.0.9 on centos 6.3 Installation notes

Source: Internet
Author: User

It is recommended to move to the Technical blog to view this article, because the layout is more suitable for reading: http://www.cnblogs.com/SW515/p/3199743.html

Preface

Mono's SuSE Linux series, owned by Novell, provides built-in support for mono and monodevelop. Therefore, it is very easy to install monodevelop in SuSE/opensuse Linux systems. However, the installation of monodevelop in other Linux branches often requires a great deal of balance. Why? The main problem lies in. Net's encapsulation of gnome/GTK libraries. When monodevelop is installed, the most common problem is that dependent components such as glib-sharp or gnome-sharp do not exist. In fact, it is not difficult to solve these dependency problems, but the guys playing monodevelop in Linux are basically. NET developers.
-- You know,. NET developers often know little about Linux ......

Centos/RHEL must be used as a server. So why should we install monodevelop? -- Debug the Assembly directly in Visual Studio and deploy the Assembly on centos. However, many implementations of Mono and. Net class libraries are quite different.(For example, typedescriptor, socket, type. GetType (...) and so on. I will write an article later to discuss these differences .), Coupled with the huge difference between Linux and Windows, these will lead to our. Net Program in. net
On Windows is normal, but running on mono on Linux may cause various strange problems. Platform compatibility is indeed a headache!

Therefore, it is necessary to install monodevelop on the centos/RHEL development machine. Of course, it would be much easier to install opensuse directly if you are in trouble. However, I have never been able to stand for all the Linux branch versions for common users. The effective interfaces and operation methods in western regions are really tough, in addition, we hope that the development will be the same as the Linux branch of the final Deployment Server to avoid unnecessary retest.

Installation Process

First, make sure that Mono is successfully installed.(Purely nonsense). Then run the following command to install GTK-sharp:

# Cd/usr/local/src
# Wget http://download.mono-project.com/sources/gtk-sharp212/gtk-sharp-2.12.21.tar.gz
# Tar-zxvf gtk-sharp-2.12.21.tar.gz
# Cd gtk-sharp-2.12.21
#./Configure -- prefix =/usr
# Make & make install

Unfortunately, in the configure command above, you will receive the following error message:

/Bin/sh:/usr/bin/gapi2-codegen:/bin/sh ^ m: Bad Interpreter: No file or directory

This prompt is very crashing. Why? Because you go to/usr/bin to find, found that there is indeed a gapi2-codegen file, this file is clearly in AH, Why did not say it ?! This is caused by the format of the script file. It's a pitfall source code package. Well, use Vim to open the file and convert the format:

# Vim/usr/bin/gapi2-codegen

Then input (including the colon) in VIM ):

: Set ff?

If you are prompted to use fileformat = DOS after executing the preceding command in Vim, use the following command in VIM:

: Set fileformat = Unix
: WQ

After completing the preceding operations, return to the command terminal and re-execute the configure command. If other files are prompted with the same error, follow these steps. After installing GTK-sharp, install gnome-sharp. It seems that this stuff has not been updated for several years, but the external components it depends on are either missing or hacked.

# Cd/usr/local/src
# Wget http://download.mono-project.com/sources/gnome-sharp2/gnome-sharp-2.24.1.tar.bz2
# Tar-jxvf gnome-sharp-2.24.1.tar.bz2
# Cd gnome-sharp-2.24.1
#./Configure -- prefix =/usr
# Make & make install

In the make stage, a code compilation error occurs: generated/canvasshape. CS (, 41): Error cs0030: cannot convert type 'glib. value' to 'art. vpathdash'

This means that the glib. valuel type cannot be converted to the art. vpathdash type. The location of the code file is:
/Usr/local/src/gnome-sharp-2.24.1/gnome/generated/canvasshape. CS

Open the CS file and find the error. The content is as follows:

[Glib. Property ("Dash")]
Public Art. vpathdash dash {
Get {
Glib. Value val = getproperty ("Dash ");
Art. vpathdash ret = (art. vpathdash) val;
Val. Dispose ();
Return ret;
}
Set {
Glib. Value val = new glib. Value (value );
Setproperty ("Dash", Val );
Val. Dispose ();
}
}

This is the gnome code, and I have never used it. simply change the highlighted code above to: Art. vpathdash ret = new art. vpathdash ();

Save and exit, and then re-execute the make command, and you will encounter a "Mono not found. getoptions. DLL assembly "Compilation error, which is caused by mono. getoptions. DLL has been renamed to mono in the existing version. options. DLL, but the source code of gnome C # Bind package has not been updated in time. However. options. when the DLL is copied to the same directory of the source code and the compilation reference is modified, the system prompts that some classes and namespaces do not exist. This indicates that the Assembly has been renamed, the class and namespace are also changed. Nima, This is a pitfall...

Then you can simply use mono. getoptions. dll.(The name of this Assembly is too embarrassing. It was written by a temporary engineer)The compilation script is located at:/usr/local/src/gnome-sharp-2.24.1/sample/gnomevfs/makefile. Use Vim to open the script, comment out the scripts of lines 221, 449, and 450 (as shown below ):

# Extra_target = testxfer.exe
Export testxfer.exe: $ (srcdir)/testxfer. CS $ (assemblies)
# $ (CSC)/out: testxfer.exe $ (references)-R: Mono. getoptions. dll $ (srcdir)/testxfer. CS

The compiled script commented out above should not cause any problems, because it can be seen that it is only a test project in the sample! Well, if the character is correct, you can compile and install gnome-sharp. Finally, execute monodevelop compilation and installation:

# Cd/usr/local/src/monodevelop-4.0.9
#./Configure -- prefix =/usr
# Make & make install

Summary

The main problem with monodevelop installation in centos/RHEL Linux is that dependent components such as glib-sharp and gnome-sharp do not provide a simple RPM package, however, you need to use the source code for compilation and installation, and compile the code. What hurts you is the various kinds of difficulties and pitfalls contained in these source code packages, this is why Linux cainiao like me suffer.

It took me a long time to install monodevelop on centos 6.3. I had some detours in the middle because I knew monodevelop was self-contained in opensuse, therefore, we first find RPM packages such as glib-Sharp from opensuse packages, but this cannot be done. Then we found various RPM packages on Google, during which Google was attacked n times, every time I had to wait for a while before I could use it. It felt like I hate heaven and the sky ~ Bytes

Finally, there is no picture and no truth. I have attached a monodevelop 4.0.9 on centos 6.3, which is also a souvenir! Finally, we can migrate the development platform to centos/monodevelop. We hope monodevelop4 will be able to meet our expectations!

Related Article

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.