gpgme does not find engine on windows

Andre Heinecke aheinecke at
Wed Jul 15 19:59:47 CEST 2015


On Wednesday, July 15, 2015 10:42:14 AM Jeroen Ooms wrote:
> I wrote some gpgme bindings for the R programming language, and they
> work great on OSX and Linux, but I am having difficulty getting it to
> work on Windows. The gpgme library has been compiled with mingw-w64
> (gcc 4.6.3). The code builds and links, but the program fails with
> 'Invalid crypto engine' when calling

gpgme is pretty much untested as 64bit binary on Windows.
Gpg4win only uses it as a 32bit binary. So I would stick with a 32 bit version 
of gpgme to avoid problems.

>   gpgme_engine_check_version(GPGME_PROTOCOL_OpenPGP);

Did you initialize gpgme with gpgme_check_version [1] before this call?

> I tried both using the gpg2.exe or gpgconf.exe engine from gpg4win as
> well as from msys2 but gpgme seems unable to find it. 

If you have a working gpgconf in your PATH environment variable you should not 
need to set anything for gpgme to work. Can you execute gpgconf from the 
command line on your system? (From another working directory)
> So my questions: are there working examples of gpgme on windows?

Of course, check out Kleopatra, GPA etc. and take a look at gpgme/tests
especially gpgme-tool.c is a good example of how you can work with gpgme.

> Should it be possible for a mingw-w64 build of gpgme to use the
> gpg4win engine?

To be clear: As the name mingw-w64 is ambigous: 
32 bit builds with mingw-w64 (i686-w64-mingw32) are well tested and is the 
compiler gpg4win itself uses.
64 bit ( x86_64-w64-mingw32 ) versions are untested and I don't know if they 



Andre Heinecke |  ++49-541-335083-262  |
Intevation GmbH, Neuer Graben 17, 49074 Osnabrück | AG Osnabrück, HR B 18998
Geschäftsführer: Frank Koormann, Bernhard Reiter, Dr. Jan-Oliver Wagner

More information about the Gnupg-devel mailing list