LinuxCommandLibrary

vala

Compile Vala source to C or binaries

TLDR

Compile to C

$ vala [file.vala]
copy
Compile and link
$ vala -o [output] [file.vala]
copy
With package
$ vala --pkg [gtk4] [file.vala]
copy
Generate header
$ vala -H [header.h] -C [file.vala]
copy

SYNOPSIS

vala [-o output] [--pkg name] [options] files

DESCRIPTION

vala compiles Vala source code into C and optionally into native executables. 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 compiler generates C source files that can be compiled with any standard C compiler. This approach gives Vala programs native performance with no runtime overhead while allowing seamless interoperability with existing C libraries. The --pkg flag links against system libraries discovered through pkg-config.

PARAMETERS

-o FILE

Output executable.
--pkg NAME
Include package.
-C
Generate C only.
-H FILE
Generate header.
-d DIR
Output directory.

CAVEATS

GNOME ecosystem. Generates C. Requires GLib.

HISTORY

Vala was created by Jürg Billeter for GNOME development, compiling to C with GObject support.

SEE ALSO

valac(1), gcc(1), glib(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community