Using Mono on Windows

被刻印的时光 ゝ 提交于 2019-12-23 09:05:42

问题


I know it sounds stupid but:

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;

I guess they're Mono specific libraries.

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

I'm trying to learn C#

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

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

EDIT

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

No, it doesn't work :(


回答1:


Mono on windows guide

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. 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.

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.




回答2:


Yes, you can install mono under windows. There is an experimental installer.

See: http://mono-project.com/Mono:Windows

That page also has information on the gtk libs.




回答3:


Of course you can run mono under windows:

http://www.go-mono.com/mono-downloads/download.html




回答4:


The Gdk is a cross-platform library for low-level windowing system stuff, and the code is using .NET binding to Gdk. It is available for windows (as a part of Gtk# package or in Mono installer).

Mono.Unix is a mono library that provides access to unix services (syscalls, stdlib). I do not think that Mono.Unix is available for windows, but Mono.Posix might be available.



来源:https://stackoverflow.com/questions/836767/using-mono-on-windows

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!