Using Vala on Windows
Introduction#
This topic focuses on how to get valac running on Windows.
Using msys2 (64 Bit)
-
Install msys2 (https://www.msys2.org/)
-
Install the required prerequisites for Vala
pacman -S mingw64/mingw-w64-x86_64-gcc pacman -S mingw64/mingw-w64-x86_64-pkg-config pacman -S mingw64/mingw-w64-x86_64-vala
and all the additional packages your code requires, i.e.
pacman -S mingw64/mingw-w64-x86_64-libgee ...
-
Launch the correct msys2 shell
C:\msys64\mingw64.exe
-
Check the
MSYSTEM
andPKG_CONFIG_PATH
environment variables$ echo $MSYSTEM MINGW64 $ echo $PKG_CONFIG_PATH /mingw64/lib/pkgconfig:/mingw64/share/pkgconfig
-
Run
valac
as usual, but make sure to always work in the correct environment (see steps 3 and 4)For example let’s build the first GeeSample here:
$ valac gee-list.vala --pkg gee-0.8