Search code examples
mingwmsys2

p11tool on 32bit MSYS2 cannot load


I'm trying to run p11tool on 32bit MSYS2 console. It says it cannot load libtasn1-6.dll. Can anyone figure out the reason and solution?

  • Windows 7 64bit professional
  • MSYS2 msys2-i686-20190524.exe
$ pacman -S mingw-w64-i686-gnutls
warning: mingw-w64-i686-gnutls-3.6.8-2 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (1) mingw-w64-i686-gnutls-3.6.8-2

Total Installed Size:  11.73 MiB
Net Upgrade Size:       0.00 MiB

:: Proceed with installation? [Y/n] Y
(1/1) checking keys in keyring                     [#####################] 100%
(1/1) checking package integrity                   [#####################] 100%
(1/1) loading package files                        [#####################] 100%
(1/1) checking for file conflicts                  [#####################] 100%
(1/1) checking available disk space                [#####################] 100%
:: Processing package changes...
(1/1) reinstalling mingw-w64-i686-gnutls           [#####################] 100%
$ pacman -S mingw-w64-i686-libtasn1
warning: mingw-w64-i686-libtasn1-4.14-1 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (1) mingw-w64-i686-libtasn1-4.14-1

Total Installed Size:  0.48 MiB
Net Upgrade Size:      0.00 MiB

:: Proceed with installation? [Y/n] y
(1/1) checking keys in keyring                     [#####################] 100%
(1/1) checking package integrity                   [#####################] 100%
(1/1) loading package files                        [#####################] 100%
(1/1) checking for file conflicts                  [#####################] 100%
(1/1) checking available disk space                [#####################] 100%
:: Processing package changes...
(1/1) reinstalling mingw-w64-i686-libtasn1         [#####################] 100%
$ p11tool --help
C:/msys32/mingw32/bin/p11tool.exe: error while loading shared libraries: libtasn1-6.dll: cannot open shared object file: No such file or directory
$ whereis libtasn1-6.dll
libtasn1-6: /mingw32/bin/libtasn1-6.dll

Solution

  • I learn a technique to tell actually missing file for a MinGW application. Running the command on CMD can show accurate error message.

    For me, it says "The program can't start because "libhogweed-5.dll" is missing from your computer."

    My computer has libhogweed-4.dll, and installing libhogweed cannot solve it. Then I googled and found mingw-w64-x86_64-nettle contains "libhogweed-5.dll". Since it is 64bit, I read x86-64 as i686 for 32bit.

    Therefore the solution was;

    $ pacman -S mingw-w64-i686-nettle
    

    I think it is a problem in a particular version of mingw-w64-i686-gnutls, and will be fixed later.