我是C#的新手,不知道它的语法。但我对其他语言(Java、C++)略有了解。我下载了GLWidget project并尝试构建它。然而,我在这些行(使用{ get; set; })得到了一个错误CS0501:
namespace Gtk
{
[ToolboxItem(true)]
public class GLWidget : DrawingArea, IDisposable
{
IGraphicsContext graphicsContext;
static int graphicsContextCount;
/// <summary>Use a single buffer versus a double buffer.</summary>
[Browsable(true)]
public bool SingleBuffer { get; set; }
/// <summary>Color Buffer Bits-Per-Pixel</summary>
public int ColorBPP { get; set; }
/// <summary>Accumulation Buffer Bits-Per-Pixel</summary>
public int AccumulatorBPP { get; set; }
/// <summary>Depth Buffer Bits-Per-Pixel</summary>
public int DepthBPP { get; set; }
/// <summary>Stencil Buffer Bits-Per-Pixel</summary>
public int StencilBPP { get; set; }
/// <summary>Number of samples</summary>
public int Samples { get; set; }
/// <summary>Indicates if steropic renderering is enabled</summary>
public bool Stereo { get; set; }
IWindowInfo windowInfo;为什么这家伙要这么做?这是不是一个小错误?
发布于 2011-12-31 05:36:41
你使用的是什么版本的编译器?这段代码使用的是C# 3.0及更高版本中提供的Auto-Implemented Properties。
因为我假设MonoDevelop使用的是Mono compiler 'mcs‘(和变体),所以这个问题取决于Mono的版本。Mono 2.6支持C# 3.0 (以及4.0的预览版)。也许你只需要升级Mono和/或MonoDevelop即可。
发布于 2011-12-31 05:37:56
自动属性是在c# 3.0中引入的,因此请尝试更改框架版本。
https://stackoverflow.com/questions/8684298
复制相似问题