2

我正在尝试在 Genie 中列出一个列表,但它似乎不起作用。编译代码:

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

产生这些错误:

someone@someone-UBook:~/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 apt-get install libgee2)并且没有任何变化。有任何想法吗?

4

1 回答 1

5

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

于 2011-12-27T19:41:50.870 回答