Compiling GnuPG for Windows

Dr. Vesselin Bontchev vbontchev at
Fri Jun 20 19:02:58 CEST 2014

Hello folks,

Could somebody please point me to a step-by-step guide for compiling GnuPG for Windows? The particular brand of Windows I use is Windows 7 Professional 64-bit - but I want to compile just the 32-bit version. Also, I need only gpg - not the other tools.

Long time ago, when there was no GnuPG, I was involved in the development of PGP - cleaned up the code a bit to reduce the number of compiler warnings, wrote some scripts for integration with a popular (at the time) e-mail program (Elm) and so on. But at that time (decades ago), I was just able to compile PGP for DOS using the Borland C compiler without any problems... How things have changed, eh?

It seems that nowadays gpg is heavily *nix-ish, so I guess I need the gcc compiler. I found this guide

but it seems to be heavily outdated. Even its instructions for installing MinGW didn't work "out-of-the-box". I had to figure out by myself that I need to add C:\MinGW\bin to the PATH and how to start the shell (no entry for that is created by the MinGW installer on the Start menu - only a link to the installer itself is created there).

However, I still cannot compile GnuPG. The process stops while running ./configure, complaining about a missing library. According to the README in the GnuPG distribution, I need to compile and install the following libraries first (something which the guide doesn't mention at all):

  libgpg-error     (
  libgcrypt        (
  libksba          (
  libassuan >= 2.0 (

However, I cannot do even that much. I downloaded them, switched to the directory for the first one, ran ./configure, then make - but the compilation process barfs with the following error message:

c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: .libs/libgpg-error-0.dll.def:8: syntax error
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe:.libs/libgpg-error-0.dll.def: file format not recognized; treating as linker script
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe:.libs/libgpg-error-0.dll.def:7: syntax error
collect2.exe: error: ld returned 1 exit status

What now? Is there anywhere an understandable and up-to-date guide how to compile the whole thing?


More information about the Gnupg-users mailing list