无法使用单声道命令提示符为gtk#编译hello.cs [英] cannot compile hello.cs for gtk# using mono command prompt

查看:82
本文介绍了无法使用单声道命令提示符为gtk#编译hello.cs的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

曾希望会有所帮助,但会出现其他错误.

Had hoped that this would help, but getting a different error.

试图将以下内容编译为hello.cs

attempting to compile the following as hello.cs

using Gtk;
using System;
class Hello
{
    static void Main()
    {
        Application.Init();
        Window window = new Window("helloworld");
        window.Show();
        Application.Run();
    }
}

使用以下命令"gmcs hello.cs -pkg:gtk-sharp-2.0"进行编译

Compiling with the following command "gmcs hello.cs -pkg:gtk-sharp-2.0"

根据命令提示符,我收到cs0006(单cp)或cs2001(win cp),说找不到文件 从mono cp表示找不到元数据文件 从win cp得知找不到源文件

depending on the command prompt, I'm receiving either cs0006 (mono cp) or cs2001 (win cp) saying that files cannot be found from mono cp it says that the metadata file cannot be found from win cp it says that source file cannot be found

这里是一个示例:

c:\Users\Stephen Lloyd\Desktop>gmcs hello.cs -pkg:gtk-sharp-2.0
-r:C:/Program Files \(x86\)/Mono-2.10.8/lib/mono/gtk-sharp-2.0/pango-sharp.dll \(x86\)/Mono-2.10.8/lib/mono/gtk-sharp-2.0/atk-sharp.dll \(x86\)/Mono-2.10.8/lib/mono/gtk-sharp-2.0/gdk-sharp.dll \(x86\)/Mono-2.10.8/lib/mono/gtk-sharp-2.0/gtk-sharp.dll \(x86\)/Mono-2.10.8/lib/mono/gtk-sharp-2.0/glib-sharp.dll  
error CS2001: Source file `Files' could not be found
error CS2001: Source file `\(x86\)/Mono-2.10.8/lib/mono/gtk-sharp-2.0/pango-sharp.dll' could not be found
error CS2001: Source file `\(x86\)/Mono-2.10.8/lib/mono/gtk-sharp-2.0/atk-sharp.dll' could not be found
error CS2001: Source file `\(x86\)/Mono-2.10.8/lib/mono/gtk-sharp-2.0/gdk-sharp.dll' could not be found
error CS2001: Source file `\(x86\)/Mono-2.10.8/lib/mono/gtk-sharp-2.0/gtk-sharp.dll' could not be found
error CS2001: Source file `\(x86\)/Mono-2.10.8/lib/mono/gtk-sharp-2.0/glib-sharp.dll' could not be found
Compilation failed: 6 error(s), 0 warnings

在所有情况下,引用的.dll都位于该文件夹中.

In all cases the referenced .dlls are in that folder.

有什么想法吗?

推荐答案

作为手动输入引用的一种替代方法,我发现将Mono安装到不带空格的路径(也称为C:\ devtools \ mono),然后添加... C:\ devtools \ mono \ bin到您的路径.命令对我来说是成功的.顺便说一句,在Windows上使用unix devtools之前,我也遇到过类似的问题,并且在这里也行得通.

As an alternative to manually entering references, I found it easier to just install mono to a path with no spaces aka C:\devtools\mono and then adding the ... C:\devtools\mono\bin to your path. The command was then successful for me. As an aside I have had a similar problem before with using unix devtools on windows and this has worked there as well.

这篇关于无法使用单声道命令提示符为gtk#编译hello.cs的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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