Skip to content

Compiling TigerVNC for Windows

Danny Park edited this page Jun 4, 2020 · 9 revisions

Using MSYS2 and Mingw-w64 to compile TigerVNC 64 bit on Windows 10 64 bit

This wiki was initially started because at least one developer realized there was no straight forward approach to get TigerVNC compiling for Windows and test contributions to the project. Feel free to update this with new and/or better information.

Install MSYS2

MSYS2 is a self proclaimed "software distro and building platform for Windows". Please go to their website https://www.msys2.org/, download the one click installer and run it.

Install prerequisite packages

pacman -S mingw-w64-x86_64-cmake

pacman -S mingw-w64-x86_64-fltk

pacman -S mingw-w64-x86_64-gnutls

pacman -S mingw-w64-x86_64-gcc

pacman -S mingw-w64-x86_64-make

Clone the TigerVNC project

git clone https://github.com/TigerVNC/tigervnc.git

Patch TigerVNC

Pull request in process. See pull request #1039 (https://github.com/TigerVNC/tigervnc/pull/1039)

Create a build directory in the tigervnc repo

Start MSYS2-MinGW 64 bit

cd tigervnc

mkdir build

cd build

Configure the build environment and run it

cmake -G "MinGW Makefiles" ../

mingw32-make.exe

Create the Windows Installer

Install Inno Setup 6 from https://jrsoftware.org/isinfo.php.

Add the path to your MinGW 64-bit path.

export PATH=/c/Program\ Files\ \(x86\)/Inno\ Setup\ 6/:$PATH

Create the installer.

mingw32-make.exe installer

Note for compatibility with Windows 7

Apparently the windows kernel32.dll exports a reference to CreateProcessAsUserA in Windows 10 but not in Windows 7. The libkernel32.a for newer versions of crt-git contain that export. That causes a runtime error in Windows 7. Version 6 does not have that reference so it properly links to advapi32.dll for Windows 7.

If you want a binary that is compatible with Windows 7, download mingw-w64-x86_64-crt-git-6.0.0.5225.fb06a4bf-1-any.pkg.tar.xz from http://repo.msys2.org/mingw/x86_64/ and then install it with the following command:

pacman -U mingw-w64-x86_64-crt-git-6.0.0.5225.fb06a4bf-1-any.pkg.tar.xz