Mono和MonoDevelop源码编译安装

之所以用源码编译的方式安装mono和monodevelop,是因为通过yum安装的mono不是最新版本,而且monodevelop不能建 asp.net MVC3的工程。

而且通过源码安装,可以进一步了解mono的各个项目之间的关系。

我用的Fedora16系统

1. mono的源码编译安装

下载mono的最新源码,github上的源码编译时总是报找不到 gmcs.exe的错误。

我是在mono的官网上下的最新源码,地址:https://wrench.mono-project.com/Wrench/index.aspx?show_all=true

我下的是mono-2.11.3版

# tar jxvf mono-2.11.3.tar.bz2 # cd mono-2.11.3 # ./autogen.sh –prefix=/usr/local # make # make install

需要注意的是用root用户来安装,否则有错误。

2. monodevelop的源码编译安装

monodevelop的源码编译安装相当曲折,搞了好几天。

有几点需要注意:

在monodevelop的官网上下最新源码,否则在./configure时会有找不到文件的错。 在安装monodevelop之前,要先安装一些依赖的包。(mono-addins,gtk-sharp,libglade2,gnome-sharp-2.0) 安装完后,需要设置LD_LIBRARY_PATH这个环境变量 用root用户来安装

安装monodevelop之前,按顺序安装一些依赖包:

(gtk-sharp –> mono-addins–> libglade2–> gnome-sharp-2.0)

这些包在安装时也会遇到各种问题,下面是我安装时遇到的各种问题及解决方法,,供参考。

以上的安装顺序是我总结出来的,没有试验过。

我安装时并不知道上面的安装顺序,是直接安装monodevelop,然后遇到问题再解决的。我的安装顺序如下:

1) 和mono同样的网址下载monodevelop的最新代码。

# tar jxvf monodevelop-3.1.0.tar.bz2 # cd monodevelop-3.1.0 # ./configure –prefix=`pkg-config –variable=prefix mono`

此时报了一个错误如下:找不到 UNMANAGED_DEPENDENCIES_MONO

====================================================================[root@localhost monodevelop-3.1.0]# ./configure –prefix=`pkg-config –variable=prefix mono`checking for a BSD-compatible install… /usr/bin/install -cchecking whether build environment is sane… yeschecking for a thread-safe mkdir -p… /bin/mkdir -pchecking for gawk… gawkchecking whether make sets $(MAKE)… yeschecking how to create a ustar tar archive… gnutarchecking whether to enable maintainer-specific portions of Makefiles… nochecking for mono… /usr/local/bin/monochecking for gmcs… /usr/local/bin/gmcschecking for update-mime-database… /usr/bin/update-mime-databasechecking for pkg-config… /usr/bin/pkg-configchecking for msgfmt… /usr/bin/msgfmtchecking for msgmerge… /usr/bin/msgmergechecking pkg-config is at least version 0.9.0… yeschecking for UNMANAGED_DEPENDENCIES_MONO… noconfigure: error: Please install mono version 2.8 or later to install MonoDevelop.Please see to download latest mono sources or packages====================================================================

通过以下命令修复此错误:

# export PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/local/lib/pkgconfig

再次执行:

# ./configure –prefix=`pkg-config –variable=prefix mono`

此时报了一个错误如下:找不到 mono-addins

====================================================================checking for UNMANAGED_DEPENDENCIES_MONO… yeschecking for mono… /usr/local/bin/monochecking for dmcs… /usr/local/bin/dmcschecking for MONO_ADDINS… noconfigure: error: Package requirements (mono-addins >= 0.6) were not met:No package ‘mono-addins’ foundConsider adjusting the PKG_CONFIG_PATH environment variable if youinstalled software in a non-standard prefix.Alternatively, you may set the environment variables MONO_ADDINS_CFLAGSand MONO_ADDINS_LIBS to avoid the need to call pkg-config.See the pkg-config man page for more details.====================================================================

下载mono-addins并安装,下载地址:

# tar jxvf mono-addins-0.6.2.tar.bz2 # cd mono-addins-0.6.2 # ./configure –prefix=/usr/local

此时报了一个错误如下:找不到 gtk-sharp-2.0

====================================================================checking for a BSD-compatible install… /usr/bin/install -cchecking whether build environment is sane… yeschecking for a thread-safe mkdir -p… /bin/mkdir -pchecking for gawk… gawkchecking whether make sets $(MAKE)… yeschecking how to create a ustar tar archive… gnutarchecking whether to enable maintainer-specific portions of Makefiles… nochecking for pkg-config… /usr/bin/pkg-configchecking for a BSD-compatible install… /usr/bin/install -cchecking for gmcs… /usr/local/bin/gmcschecking for gacutil… /usr/local/bin/gacutilchecking for al… /usr/local/bin/alchecking pkg-config is at least version 0.9.0… yeschecking for GTK_SHARP_20… configure: error: Package requirements (gtk-sharp-2.0) were not met:No package ‘gtk-sharp-2.0’ foundConsider adjusting the PKG_CONFIG_PATH environment variable if youinstalled software in a non-standard prefix.Alternatively, you may set the environment variables GTK_SHARP_20_CFLAGSand GTK_SHARP_20_LIBS to avoid the need to call pkg-config.See the pkg-config man page for more details.====================================================================

下载gtk-sharp并安装,下载地址:

勇士面前无险路。

Mono和MonoDevelop源码编译安装

相关文章:

你感兴趣的文章:

标签云: