gpt4 book ai didi

mono - 无法使用 mono 命令提示符为 gtk# 编译 hello.cs

转载 作者:行者123 更新时间:2023-12-02 20:42:25 25 4
gpt4 key购买 nike

本来希望this会有所帮助,但会出现不同的错误。

尝试将以下内容编译为 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”进行编译

根据命令提示符,我收到 cs0006 (mono cp) 或 cs2001 (win cp) 消息,表示找不到文件来自 mono cp 它说找不到元数据文件来自 win cp 它说找不到源文件

这是一个示例:

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 都位于该文件夹中。

有什么想法吗?

最佳答案

-pkg 在 Windows 上已损坏;您需要提供单独的 -r[eference]:。请参阅this answer了解详情。

关于mono - 无法使用 mono 命令提示符为 gtk# 编译 hello.cs,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9136748/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com