在 Ubuntu 14.04 上使用最新的 Mono 4.3.0 和 GTK# 构建 Mono.Addins 失败
Fail to build Mono.Addins with the latest Mono 4.3.0 and GTK# on Ubuntu 14.04
正在尝试使用最新的 Mono 构建最新的 Monodevelop。我已经成功安装了 Mono 4.3.0 和 GTK#。如我所见,Monodevelop 需要安装 Mono.Addins,但是当我尝试安装最新的 Mono.Addins 时,它失败并出现以下错误:
Mono.Addins.Gui/AddinManagerDialog.cs(189,24): error CS0506: `Mono.Addins.Gui.AddinManagerDialog.Dispose()': cannot override inherited member `GLib.Object.Dispose()' because it is not marked virtual, abstract or override
Mono.Addins.Gui/AddinTreeWidget.cs(52,25): error CS0012: The type `GLib.IIcon' is defined in an assembly that is not referenced. Consider adding a reference to assembly `gio-sharp, Version=3.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f'
Mono.Addins.Gui/ManageSitesDialog.cs(67,24): error CS0506: `Mono.Addins.Gui.ManageSitesDialog.Dispose()': cannot override inherited member `GLib.Object.Dispose()' because it is not marked virtual, abstract or override
Mono.Addins.Gui/NewSiteDialog.cs(46,24): error CS0506: `Mono.Addins.Gui.NewSiteDialog.Dispose()': cannot override inherited member `GLib.Object.Dispose()' because it is not marked virtual, abstract or override
gtk-gui/generated.cs(65,52): error CS0234: The type or namespace name `SizeRequestedArgs' does not exist in the namespace `Gtk'. Are you missing an assembly reference?
Mono.Addins.Gui/HeaderBox.cs(98,27): error CS0115: `Mono.Addins.Gui.HeaderBox.OnSizeRequested(ref Gtk.Requisition)' is marked as an override but no suitable method found to override
Mono.Addins.Gui/HeaderBox.cs(125,27): error CS0115: `Mono.Addins.Gui.HeaderBox.OnExposeEvent(Gdk.EventExpose)' is marked as an override but no suitable method found to override
Mono.Addins.Gui/HoverImageButton.cs(83,44): warning CS0618: `Gtk.Style' is obsolete: `Replaced by StyleContext'
Mono.Addins.Gui/HoverImageButton.cs(150,33): error CS0115: `Mono.Addins.Gui.HoverImageButton.OnExposeEvent(Gdk.EventExpose)' is marked as an override but no suitable method found to override
如何解决?
Ubuntu 版本 - 14.04
好的,我找到了解决方案。这很简单。我只是选择了错误版本的 GTK# 库。它应该是 2.12.*
版本,但在 GTK# master 上它是 2.99.*
。当我更改版本时(通过 git checkout
),所有内容都按应有的方式编译。
只有设置了标志 --disable-gui
和 --enable-gui-gtk3
,Mono.Addins 才会使用 GTK# 的 2.99.*
进行编译。换句话说,GTK# 2.99.*
只能与 GTK+ 3.0 一起使用,因此 Mono.Addins 应该配置为使用这个版本的 GTK+。希望这个解释能对某人有所帮助。
正在尝试使用最新的 Mono 构建最新的 Monodevelop。我已经成功安装了 Mono 4.3.0 和 GTK#。如我所见,Monodevelop 需要安装 Mono.Addins,但是当我尝试安装最新的 Mono.Addins 时,它失败并出现以下错误:
Mono.Addins.Gui/AddinManagerDialog.cs(189,24): error CS0506: `Mono.Addins.Gui.AddinManagerDialog.Dispose()': cannot override inherited member `GLib.Object.Dispose()' because it is not marked virtual, abstract or override
Mono.Addins.Gui/AddinTreeWidget.cs(52,25): error CS0012: The type `GLib.IIcon' is defined in an assembly that is not referenced. Consider adding a reference to assembly `gio-sharp, Version=3.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f'
Mono.Addins.Gui/ManageSitesDialog.cs(67,24): error CS0506: `Mono.Addins.Gui.ManageSitesDialog.Dispose()': cannot override inherited member `GLib.Object.Dispose()' because it is not marked virtual, abstract or override
Mono.Addins.Gui/NewSiteDialog.cs(46,24): error CS0506: `Mono.Addins.Gui.NewSiteDialog.Dispose()': cannot override inherited member `GLib.Object.Dispose()' because it is not marked virtual, abstract or override
gtk-gui/generated.cs(65,52): error CS0234: The type or namespace name `SizeRequestedArgs' does not exist in the namespace `Gtk'. Are you missing an assembly reference?
Mono.Addins.Gui/HeaderBox.cs(98,27): error CS0115: `Mono.Addins.Gui.HeaderBox.OnSizeRequested(ref Gtk.Requisition)' is marked as an override but no suitable method found to override
Mono.Addins.Gui/HeaderBox.cs(125,27): error CS0115: `Mono.Addins.Gui.HeaderBox.OnExposeEvent(Gdk.EventExpose)' is marked as an override but no suitable method found to override
Mono.Addins.Gui/HoverImageButton.cs(83,44): warning CS0618: `Gtk.Style' is obsolete: `Replaced by StyleContext'
Mono.Addins.Gui/HoverImageButton.cs(150,33): error CS0115: `Mono.Addins.Gui.HoverImageButton.OnExposeEvent(Gdk.EventExpose)' is marked as an override but no suitable method found to override
如何解决?
Ubuntu 版本 - 14.04
好的,我找到了解决方案。这很简单。我只是选择了错误版本的 GTK# 库。它应该是 2.12.*
版本,但在 GTK# master 上它是 2.99.*
。当我更改版本时(通过 git checkout
),所有内容都按应有的方式编译。
--disable-gui
和 --enable-gui-gtk3
,Mono.Addins 才会使用 GTK# 的 2.99.*
进行编译。换句话说,GTK# 2.99.*
只能与 GTK+ 3.0 一起使用,因此 Mono.Addins 应该配置为使用这个版本的 GTK+。希望这个解释能对某人有所帮助。