Small demo showing the effort of porting GUPnP on windows:
gupnp-win32
Heute ist der Tag des großen Medienkotzens, großer Falschinformation und Feierei
If you ever wondered what parameters you could pass in that funny xmllet <GnupgKeyParms></GnupgKeyParms> when using gpgme_op_genkey:
The answer to that is
g10/keygen.c, line 2363doc/DETAILS, line 716.My current task is evaluation crypto (here: OpenPGP) solutions for Microsoft Windows; of course including GnuPG.
Well, what do I say. While there is a nice installer for GnuPG on Windows available (either here or here), try to find one for the gpgme supporting library… (including header and .lib import files for Visual Studio, that is).
You can guess… It’s all about build-your-own-stuff. It basically boils down to this:
Preparations
C:\gpgme with bin, include and lib sub folders)Compiling libgpg-error
./configure --prefix=/mingw && make installstrip src/.libs/libgpg-error-0.dll src/gpg-error.exe as MSVC can’t use gcc’s debug info anywaysrc/gpg-error.exe and src/.libs/libgpg-error-0.dll to the bin directory created abovesrc/.libs/libgpg-error-0.dll.def to lib/libgpg-error-0.def (note the renaming; otherwise your program will look for a libgpg-error-0.dll.dll)lib /machine:i386 /def:lib\libgpg-error-0.def /out:lib\libgpg-error-0.lib to create the import libraryinclude/gpg-error.h to includeCompiling gpgme
./configure --prefix=/mingw && makestrip src/gpgme-w32spawn.exe src/.libs/libgpgme-11.dllsrc/gpgme-w32spawn.exe to bin Note: To use the gpgme library, this binary has to live either in the installation dir of gpg (set in windows registry key HKLM\Software\GNU\GnuPG\Installation Directory) or in %PROGRAMFILES%\GNU\GnuPG. Otherwise gpgme will not work!src/.libs/libgpgme-11.dll to bin and src/.libs/libgpgme-11.dll.def to lib/libgpgme-11.def (Once again, note the renaming)lib /machine:i386 /def:lib\libgpgme-11.def /out:lib\libgpgme-11.lib to create the import libraryinclude/gpgme.h to includeOptional: Creating the documentation
I was not able to create the documentation properly using cygwin so I did this on a Linux host. Install a TeX distribution of your choice as well as texinfo (for Debian Lenny this would mean installing the packages texinfo, texi2html and texlive). Call make pdf in the doc subdir to generate the PDF documentation and manually call texi2html gpgme.texi for a HTML document.
Summary
Now you can add the lib dir to your Visual Studio linker settings and the include dir to your C/C++ common settings. To make gpgme work, be sure you have the gpgme-w32spawn.exe installed properly as noted above.
I hope this helps to guide one or another through the struggle of getting gpgme on windows.
Q&A
Q: gpgme does not find libgpg-error
A: You did not call make install after compiling it
Q: My program is looking for
{libgpg-error-0.dll.dll|libgpgme-11.dll.dll}
A: You did not rename the .def file before calling lib.exe
Q: I did everything you said, but when I run my program,
gpgme_engine_check_version(GPGME_PROTOCOL_OpenPGP)fails withGPG_ERR_INV_ENGINE. If I check the engine info,info->versionis empty
A: First of all, check if you copied gpgme-w32spawn.exe to the correct directory. If this is the case, actually, I have no idea what went wrong
Ok. Zugegeben. Es war eine blöde Idee, Probleme mit MySQL mit einer Überwachungssoftware lösen zu wollen, die MySQL braucht. In den entscheidenden Momenten hat man natürlich keine Daten