试图列出名字:'Gee'这个名字不存在

问题描述:

我想在Genie中创建一个列表,但它似乎不起作用。编译代码:试图列出名字:'Gee'这个名字不存在

[indent=2] 
init 
    var l = new list of string 

产生这些错误:

[email protected]:~/Documents$ valac helloworld.gs helloworld.gs:2.10-2.24: error: The name `Gee' does not exist in the context of `main' 
    var l = new list of int 
      ^^^^^^^^^^^^^^^ 
helloworld.gs:2.8-2.24: error: var declaration not allowed with non-typed initializer 
    var l = new list of int 
      ^^^^^^^^^^^^^^^^^ 
Compilation failed: 2 error(s), 0 warning(s) 

我已经安装了libgee2(通过sudo易于得到安装libgee2)并没有什么变化。有任何想法吗?

您还需要安装libgee(apt-get install libgee-dev)的开发包并告诉valac使用它(将-pkg gee-0.8添加到您的valac参数中)。