Vala on Windows


Builds of Vala for Windows are kept up to date by the MSYS2 project.

Start with the MSYS2 installer then use pacman -S package to install the required packages.

For 64-bit Windows the package architecture is given as x86_64. To install packages for 32-bit Windows change x86_64 in the list below to i686.

To install Vala on 64-bit Windows:

pacman -S mingw-w64-x86_64-gcc 
pacman -S mingw-w64-x86_64-pkg-config
pacman -S mingw-w64-x86_64-vala

MSYS2 is a distribution based on MinGW and provides a Unix(POSIX) environment that runs within Windows. This allows build tools that were developed for POSIX environments to run under Windows.

To start using this environment you usually use a launcher that starts a shell for development. For native 64-bit Windows development you need the mingw64.exe launcher. Other launchers are mingw32.exe for a 32-bit Windows development and msys2.exe for POSIX development.

Windows Subsystem for Linux (WSL)

WSL is a compatibility layer developed by Microsoft for Windows 10 and beyond. It enables Linux applications to run on Windows. The concept is similar to the Posix compatibility layer used by MSYS2.

To use WSL:

  1. Activate WSL on Windows 10

  2. Install a Linux distribution from the Microsoft Store. For example Ubuntu is available

  3. Run bash from the command prompt

After you have a bash command prompt then install Vala and tools in the same way as using a Linux distribution, e.g. sudo apt install valac for Ubuntu.

WSL is developed by Microsoft and although there is a bug tracker on GitHub they do not follow an open source/free software development model. The answer to the WSL FAQ Can I run ALL Linux apps in WSL? advises "No! WSL is a tool aimed at enabling users who need them to run Bash and core Linux command-line tools on Windows. WSL does not aim to support GUI desktops or applications (e.g. Gnome, KDE, etc.)". Although people are developing GUI applications that can run under WSL. For an example see the 'Installation' section of PDF Presenter Console. This is a GTK+ application written in Vala.

WSL may be a useful tool to get started with Vala if you are familiar with Linux. It is, however, a Linux environment, not Windows, and aimed only at recent versions of Windows.

Microsoft Visual C++

Microsoft provide a Visual Studio Community edition that is free of charge to download and use, but does not follow an open source/free software development model. The edition includes the Microsoft Visual C++ compiler that can be used to compile the C code generated by Vala.

There is currently limited documentation on using this combination and anyone interested in this development environment is encouraged to post to the Vala mailing list, write blog posts or raise questions on forums like Stack Overflow.

There are some detailed notes on Compiling the GTK+ (and Clutter) stack using Visual C++ 2008 and later on the GNOME wiki.

msitools is also a GNOME project.

Projects/Vala/ValaOnWindows (last edited 2018-03-03 19:16:17 by AlThomas)