Linux command
valac 命令
文件
复制后可按需替换文件名、目录或参数。
常用示例
Compile program
valac [file.vala]
Output executable
valac -o [output] [file.vala]
With GTK
valac --pkg [gtk4] [file.vala]
Generate C code only
valac -C [file.vala]
Debug build
valac -g [file.vala]
说明
valac is the official compiler for the Vala programming language. It performs a two-step compilation process, first translating Vala source code into C, then invoking a C compiler to produce native binaries. This design provides native performance while offering a high-level, object-oriented syntax. The compiler integrates with the GObject type system and uses pkg-config for dependency management via the --pkg flag. It is commonly used for GNOME and GTK application development, and can also generate GObject Introspection data for language bindings and C header files for library interoperability.
参数
- -o _FILE_
- Output name.
- --pkg _NAME_
- Use package.
- -C
- C code only.
- -g
- Debug symbols.
- --gir _FILE_
- Generate GIR.
- --target-glib _VER_
- GLib version.
FAQ
What is the valac command used for?
valac is the official compiler for the Vala programming language. It performs a two-step compilation process, first translating Vala source code into C, then invoking a C compiler to produce native binaries. This design provides native performance while offering a high-level, object-oriented syntax. The compiler integrates with the GObject type system and uses pkg-config for dependency management via the --pkg flag. It is commonly used for GNOME and GTK application development, and can also generate GObject Introspection data for language bindings and C header files for library interoperability.
How do I run a basic valac example?
Run `valac [file.vala]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -o _FILE_ do in valac?
Output name.