我拼命地想做一个非常简单的C#程序,利用clutter (在MonoDevelop集成开发环境中)来证明功能,但是我不熟悉C#约定。我需要构造一个杂乱对象来引用它吗?我是否在我的库中错误地声明了它?Clutter应该是我的命名空间而不是HelloWorld吗?任何帮助都将不胜感激。
using System;
using Clutter;
namespace HelloWorld {
public class HelloWorld {
public int Main () {
// Init declaration produces error:
// Expression denotes a 'type', where a 'method group' was expected
Clutter.Init ();
Stage stage = Stage.Default;
stage.Color = new Clutter.Color (0, 0, 0, 255);
stage.SetSize (512, 512);
stage.Show ();
// Main declaration produces error:
// Expression denotes a 'type', where a 'method group' was expected
Clutter.Main ();
return 0;
}
}
}发布于 2011-10-18 09:55:24
我假设Clutter是Clutter名称空间中的一个类
using System;
using Clutter;
namespace HelloWorld {
public class HelloWorld {
public int Main () {
// Init declaration produces error:
// Expression denotes a 'type', where a 'method group' was expected
Clutter c = new Clutter();
c.Init();
Stage stage = Stage.Default;
stage.Color = new Clutter.Color (0, 0, 0, 255);
stage.SetSize (512, 512);
stage.Show();
// Main declaration produces error:
// Expression denotes a 'type', where a 'method group' was expected
c.Main();
return 0;
}
}
}https://stackoverflow.com/questions/7801551
复制相似问题