尝试使用Gtk时出错CS0246#

时间:2015-08-16 20:51:39

标签: .net compiler-errors gtk#

我正在尝试使用Gtk#构建项目。

之前我使用过Gtk#,我一直在使用SharpDevelop这样做。

现在......它似乎不再起作用了:

  • 我已经使用Mono website中的安装程序包安装了最新版本的Gtk#2.12.26 for .NET,正如我之前使用早期版本所做的那样。
  • 我在SharpDevelop中创建了一个C#命令行应用程序项目,使用C#3.0并针对.NET 3.5。
  • 我已经将我的项目中的GAC参考添加到了atk-sharp,gdk-sharp,glib-sharp,gtk-sharp,Mono.Cairo和pango-sharp。
  • 我已将using Gtk;添加到我的主C#文件中。
  • 当我写Gtk.时,SharpDevelop的IntelliSense将显示Gtk命名空间中找到的所有类型。
  • 编译项目时,编译器将使用以下消息中止:
  

找不到类型或命名空间名称'Gtk'(您是否缺少using指令或程序集引用?)(CS0246)

我缺少什么?

只有在我定位.NET 3.5时才会发生这种情况。当我以.NET 4.0为目标时,我遇到了different problem

编译器的完整输出(稍微匿名化)如下所示:

Build started.
Warning MSB3245: Could not resolve this reference. Could not locate the assembly "Mono.Cairo". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
Warning MSB3245: Could not resolve this reference. Could not locate the assembly "pango-sharp". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
Warning MSB3245: Could not resolve this reference. Could not locate the assembly "gtk-sharp". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
Warning MSB3245: Could not resolve this reference. Could not locate the assembly "gdk-sharp". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
Warning MSB3245: Could not resolve this reference. Could not locate the assembly "glib-sharp". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
Warning MSB3245: Could not resolve this reference. Could not locate the assembly "atk-sharp". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
Compiling ...
...\Program.cs(3,7) : Error CS0246: The type or namespace name 'Gtk' could not be found (are you missing a using directive or an assembly reference?)
Build failed. (00:00:00.1930110)

0 个答案:

没有答案