码迷,mamicode.com
首页 > 系统相关 > 详细

[CentOS_7.4]Linux编译安装mono环境

时间:2017-10-15 14:39:10      阅读:204      评论:0      收藏:0      [点我收藏+]

标签:read   etc   版本   font   export   bz2   tar   string   port   

一 安装mono

安装过程: 下载mono安装源,配置,编译,安装,设置环境变量。

# wget http://download.mono-project.com/sources/mono/mono-5.4.0.201.tar.bz2
# tar -jxvf mono-5.4.0.201.tar.bz2
# cd mono-5.4.0.201
# ./configure --prefix=/usr/local/mono
# make && make install
# vi /etc/profile
在最后添加环境变量:
PATH=$PATH:/usr/local/mono/bin
export PATH
保存并退出

# source /etc/profile   设置生效
# echo $PATH            输出环境变量PATH的值,验证添加的变量是否生效
# mono -V               查看mono版本

  说明: --prefix=/usr/local/mono是设置mono安装的目录,因此PATH添加的就是该安装目录下的bin目录路径。

 

二 测试

# vi hello.cs

using System;
using System.Text;
namespace Hello
{
        class hello
        {
                static void Main(string[] args)
                {
                        Console.WriteLine("hello world!");
                        Console.ReadKey();
                }
        }

}
保存并退出

# mcs hello.cs      编译生成可执行程序hello.exe
# mono hello.exe    执行可执行程序

  

结束!

[CentOS_7.4]Linux编译安装mono环境

标签:read   etc   版本   font   export   bz2   tar   string   port   

原文地址:http://www.cnblogs.com/miaosha5s/p/7670401.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!