我有两个文件,client.vala
和lib.vapi
.
VAPI 定义了一个类(通常与 C 代码对话):
class Toplevel.Sub.CClass
{
public uint i;
}
并client.vala
使用类:
class Toplevel.Sub.UserClass
{
public Toplevel.Sub.CClass c_class;
}
int main()
{
var cls = new Toplevel.Sub.UserClass();
cls.c_class.i = 0;
return 0;
}
当我尝试编译程序时,出现错误:
$ valac client.vala lib.vapi
/tmp/bug/client.vala.c:7:20: fatal error: client.h: No such file or directory
compilation terminated.
error: cc exited with status 256
Compilation failed: 1 error(s), 0 warning(s)
编译器似乎想要为client.vala
.
这是一个错误还是我错过了什么?