Overview of Installing Vala
The Vala compiler produces C code. So you will also need a C compiler to produce the executable binary of the program. The binary runs on the native platform, although cross-compiling for other platforms is possible.
As the Vala community has grown more platforms have been added. This set of pages provides helpful notes for each platform. Often a package manager is used that also downloads dependencies, but if you encounter problems you should check you have installed:
- a C compiler - by default Vala uses GCC
pkg-config - a tool for passing details of libraries to the C compiler
- Vala compiler
You also need to install any libraries you may want to use in your program. Atleast the following libraries should be installed:
a C standard library, usually the GNU project's glibc
- GLib2
Testing the Install
valac is the Vala compiler and will both compile the Vala program to C and call the C compiler to produce the binary. Save the following program as my_first_program.vala
void main() {
print( "My first Vala program!\n" );
}
Then compile the program with:
valac my_first_program.vala
To run the program on a Unix command line:
./my_first_program
To run the program on a Windows command line:
my_first_program
If there are problems look at the specific notes for your platform. Otherwise move on to the Vala Documentation.