[Build] NSIS: File libstdc++-6.dll-x not found


I have built a Debian 8 VM to rebuild Gpg4Win (git tag 2.2.5).
I have followed the procedure at http://www.gpg4win.org/build-installer-gnulinux.html adding the required packages with apt-get when required.

The packages compile fine, but I’m stuck at the MakeNSIS step :
File: “/home/builder/gpg4win/src/libstdc+±6.dll-x” → no files found.
Usage: File [/nonfatal] [/a] ([/r] [/x filespec […]] filespec […] |
/oname=outfile one_file_only)
!include: error in script: “inst-gpg4win.nsi” on line 93
!include: error in script: “inst-sections.nsi” on line 22
Error in script “./gpg4win.nsi” on line 223 – aborting creation process

The file “inst-gpg4win.nsi” is the following around line 93:
89: SetOutPath “$INSTDIR\pub”
90: # Install the mingw32 runtime libraries. They are stored in the
91: # build directory with a different suffix, so that makensis does not
92: # list sumbol names.
93: File /oname=libstdc+±6.dll “${BUILD_DIR}/libstdc+±6.dll-x”
94: File /oname=libgcc_s_sjlj-1.dll “${BUILD_DIR}/libgcc_s_sjlj-1.dll-x”
96: !endif
There is no file named “libstdc+±6.dll-x” or “libgcc_s_sjlj-1.dll-x” in the whole gpg4win tree.

Is there something obvious I have missed ?


thanks for noticing this. During configuration gpg4win looks for libstdc+±6 and libgcc_s_sjlj-1 on the system and copies them into the src folder so that they are at a known location during NSIS.

I’ve just checked that on debian jessie this fails because the paths for these files have changed. There should be a configure warning if that is the case but there is an error in the configure script that prevents it from showing up. (Also just noticed that :wink: )

We’ve build gpg4win-2.2.5 on debian wheezy. The next 2.2.x release will also be compiled on wheezy (branch gpg4win-2). (I see that your linked documentation still mentions squeeze, this is outdated the README of gpg4win has more accurate information)

We will switch the compiler / build system with a 3.0.x (current git master which is highly unstable / has known issues due to the different way we are installing gnupg 2.1)

The easiest solution for you will be to just copy:
/usr/lib/gcc/i686-w64-mingw32/4.9-win32/libgcc_s_sjlj-1.dll and
/usr/lib/gcc/i686-w64-mingw32/4.9-win32/libstdc+±6.dll to your src directory.

But I know at least two problems when you build on jessie: pinentry-qt4 will not work and you wil additionall need: /usr/i686-w64-mingw32/lib/libwinpthread-1.dll which is currently not packaged by gpg4win.


I managed to pass this problem using the autogen.sh arguments “–with-libstdc+±dll=” and “–with-libgcc_s_sjlj-1-dll=” pointing to the files in /usr/lib/gcc/i686-w64-mingw32/4.9-win32/.

However, I hit another one about gpgex not beeing found.
I’m switching to Debian Wheezzy…

I did some updates to the build documentation yesterday.

Anyway. With regards to gpgex this is probably because the 64 bit version was not enabled.

To enable building gpegex also for 64bit use: ./autogen.sh --build-w32-w64

Sorry that this option is not documented properly. I’ve already removed it in master:

Thanks for that option, I now have a working building environment.

For information, I did a netinstall of Debian Wheezy (7.8) with “SSH Server” and “Standard system utilities” package groups. I added the following packages :

  • mingw32 (listed)
  • nsis (listed)
  • stow (listed)
  • unzip (listed)
  • texinfo (listed)
  • imagemagick (listed)
  • libglib2.0-dev (listed)
  • mingw-w64
  • autoconf2.59
  • gettext (for msgfmt)
  • docbook-utils (for docbook2xxx tools)
  • libgdk-pixbuf2.0 (for gdk_pixbuf_csource)
  • libqt4-dev-bin (for moc)
  • texlive-latex-extra
  • texlive-lang-german (for the ngerman latex package)