在Windows上使用Mono [英] Using Mono on Windows

查看:168
本文介绍了在Windows上使用Mono的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这听起来很愚蠢,但是:

I know it sounds stupid but:

我发现应用程序是用Mono语言编写的,它是开源的.

I've found this application written on Mono and it is open source.

在查看源代码时,我发现这两个使用"指令使我停下脚步:

While peeking at the source code I've found this two "using" directive that stoped me:

using Gdk;

using Mono.Unix;

我想它们是Mono特定的库.

I guess they're Mono specific libraries.

那么,可以在Windows下运行Mono吗? (也许是Visual Studio Express版?)

So, it is possible to run Mono under Windows? ( perhaps Visual Studio express edition ? )

我正在尝试学习C#

我看到应用程序有Windows分支,但它是空的.

I see there is a Windows branch of the app, but it is empty.

顺便说一句:Mono首先考虑跨平台吗?

BTW: Is it Mono thought for cross platform in first place?

编辑

我已经下载/安装并运行示例代码

I've downloaded/installed and run the sample code

using Mono.Unix;

class X { static void Main () { System.Console.Write("OK");} } 

我自己的问题的答案是:

And the answer to my own question is:

x.cs(1,12): error CS0234: The type or namespace name `Unix' does not exist 
in the namespace `Mono'. Are you missing an assembly reference?
Compilation failed: 1 error(s), 0 warnings

不,它不起作用:(

推荐答案

Windows指南上的Mono

我不确定您是否可以使用Mono.Unix命名空间使用代码,但是通常,如果您要创建跨平台代码,则不必这样做.

I am not sure you will be able to use code using the Mono.Unix namespace, but generally if you are creating cross platform code, you shouldn't have to.

Gnome Do linux port .但是,对于一个学习项目,我可能建议从实际上是跨平台的代码开始,或者现在就在Linux上开发.解决跨平台问题以及可能不完整的端口只会使学习过程复杂化.

Gnome Do linux port. For a learning project however, I might suggest starting with code that is actually cross platform, or develop on Linux for now. Tackling cross platform issues and possibly an incomplete port will just complicate the learning process.

因此,我想总结一下您的第一个问题.是的,您可以在Windows上运行Mono,但是可以编写平台特定的代码,您选择的示例应用程序确实可以完成.我上面提供的链接是使该代码在Windows上运行的端口.如果不进行移植(更改平台特定的代码),该程序将无法在Windows上编译.

So, I suppose in summary to your initial question. Yes, you can run Mono on Windows, but it is possible to write platform specific code, which the example application you have chosen has indeed done. The link I provided above is a port to make that code work on Windows. Without porting ( changing the platform specific code ), that program will not compile on windows.

这篇关于在Windows上使用Mono的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆