Fwd: gpgme-w32spawn problem on Windows

Miguel Castrillo castrillo.miguel at gmail.com
Sat Sep 19 18:26:01 CEST 2015


I have a problem regarding GPGME and Windows. I have searched for
information on the list and on the Web but I couldn't get much more
information on it.

What I wanted is to create a program on C++ using OpenPGP. I did it
and on Linux it works perfectly, but I have to make it working on
Windows also. I am running Visual Studio 2013 and I followed the
instructions here http://jensge.org/tag/crypto/ , comipling with
Mingw32 on a Windows 32 machine, in order to get the def and lib files
to link the DLL in implicit way.

I did it and everything runs, the problem is when the code arrives to
gpgme_engine_check_version(GPGME_PROTOCOL_OpenPGP) which gives an
Invalid Engine Error.

If I look at the debug output I get the following:

gpgme:reader: leave
  _gpgme_io_close: leave: result=0
  _gpgme_io_pipe: enter: filedes=0030ef10, inherit_idx=1 (GPGME uses
it for reading)
  _gpgme_io_pipe: leave: read=0x0 (0000008c/0x0), write=0x1 (00000084/0x0)
  _gpgme_io_spawn: enter: path=001d2e00, path=C:\Program
  _gpgme_io_spawn: check: path=001d2e00, argv[ 0] = C:\Program
  _gpgme_io_spawn: check: path=001d2e00, argv[ 1] = --version
  _gpgme_io_spawn: check: path=001d2e00, tmp_name =
  _gpgme_io_spawn: check: path=001d2e00, CreateProcess ready:
hProcess=00000090, hThread=00000094, dwProcessID=4968, dwThreadId=2980
  _gpgme_io_spawn: check: path=001d2e00, process=00000090
    _gpgme_io_close: enter: fd=00000001
    _gpgme_io_close: check: fd=00000001, fd=1 -> handle=00000084
socket=-1 dupfrom=-1
    _gpgme_io_close: leave: result=0
  _gpgme_io_spawn: check: path=001d2e00, fd[0] = 0x1 -> 0x4 (stdout)
  _gpgme_io_spawn: leave: result=0
  _gpgme_io_read: enter: fd=00000000, buffer=0030ef44, count=79
    gpgme:create_reader: enter: fd=00000000
    gpgme:create_reader: check: fd=00000000, fd=0 -> handle=0000008c
socket=-1 dupfrom=-1
      gpgme:get_desired_thread_priority: call: 0=00000000, 2 (default)
    gpgme:create_reader: leave
  _gpgme_io_read: check: fd=00000000, waiting for data from thread 00000084
gpgme:reader: enter: ctx->file_hd=0000008c, file_sock=-1, thread=00000084
gpgme:reader: check: ctx->file_hd=0000008c, reading 4095 bytes
gpgme:reader: check: ctx->file_hd=0000008c, got EOF (broken pipe)
gpgme:reader: check: ctx->file_hd=0000008c, waiting for close
  _gpgme_io_read: check: fd=00000000, data from thread 00000084 available
  _gpgme_io_read: leave: result=0
  _gpgme_io_close: enter: fd=00000000
  _gpgme_io_close: check: fd=00000000, fd=0 -> handle=0000008c
socket=-1 dupfrom=-1
  _gpgme_io_close: leave: result=0
gpgme:reader: leave
gpgme_new: leave: ctx=001d2a08
gpgme_set_protocol: enter: ctx=001d2a08, protocol=0 (OpenPGP)
gpgme_set_protocol: leave
gpgme_set_armor: call: ctx=001d2a08, use_armor=1 (yes)
engine.c:365: returning error: Invalid crypto engine
engine.c:155: returning error: Invalid crypto engine

What it could be the problem? Have you an idea? Thanks in advance!

Miguel Castrillo Melguizo

Miguel Castrillo Melguizo

More information about the Gnupg-devel mailing list