Linux command
vala 命令
文件
复制后可按需替换文件名、目录或参数。
常用示例
Run a Vala program
vala [file.vala]
Run with a package
vala --pkg [gtk4] [file.vala]
Run with multiple
vala --pkg [gio-2.0] [file1.vala] [file2.vala]
Pass arguments
vala [file.vala] -- [arg1] [arg2]
说明
vala compiles and immediately runs Vala source code without producing persistent output files. It is equivalent to running valac --run and is useful for scripting and quick testing. For producing compiled binaries or C source files, use valac instead. Vala provides a modern, C#-like syntax with features such as type inference, lambda expressions, and signals while compiling down to plain C code that uses the GObject type system. The --pkg flag links against system libraries discovered through pkg-config.
参数
- --pkg _NAME_
- Include package (resolved via pkg-config).
- --vapidir _DIR_
- Look for VAPI files in the given directory.
- --girdir _DIR_
- Look for GIR files in the given directory.
- --version
- Display version number.
FAQ
What is the vala command used for?
vala compiles and immediately runs Vala source code without producing persistent output files. It is equivalent to running valac --run and is useful for scripting and quick testing. For producing compiled binaries or C source files, use valac instead. Vala provides a modern, C#-like syntax with features such as type inference, lambda expressions, and signals while compiling down to plain C code that uses the GObject type system. The --pkg flag links against system libraries discovered through pkg-config.
How do I run a basic vala example?
Run `vala [file.vala]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does --pkg _NAME_ do in vala?
Include package (resolved via pkg-config).