Failed to compile SSL (HAVE_EVP_MD_CTX_FREE)

I hope it is ok if I add another compiler problem. This time, it is MSYS2/Rtools (gcc 8.3), cmake was cmake -DSWIPL_PACKAGES_X=OFF -DINSTALL_DOCUMENTATION=OFF -DMINGW_ROOT=/mingw64 -G “MSYS Makefiles” …

I get two problems:

  1. C:/…/swipl-devel/packages/ssl/cryptolib.c:53:1: error: static declaration of ‘EVP_MD_CTX_free’ follows non-static declaration
    EVP_MD_CTX_free(EVP_MD_CTX *ctx)
    ^~~~~~~~~~~~~~~
    In file included from C:/rtools40/mingw64/include/openssl/hmac.h:15,
    from C:/Users/matth/Seafile/2021-SS-QHelp/rolog/src/swipl-devel/packages/ssl/crypto4pl.c:40:
    C:/rtools40/mingw64/include/openssl/evp.h:540:6: note: previous declaration of ‘EVP_MD_CTX_free’ was here
    void EVP_MD_CTX_free(EVP_MD_CTX *ctx);

  2. C:/…/swipl-devel/packages/ssl/ssl4pl.c:718:73: error: dereferencing pointer to incomplete type ‘X509_CRL’ {aka ‘struct X509_crl_st’}
    unify_hash(hash, palg->algorithm, i2d_X509_CRL_INFO_wrapper, crl->crl) &&

I can solve the problem by adding

#define HAVE_EVP_MD_CTX_FREE 1 // added by MG
#define HAVE_X509_DIGEST 1
#define HAVE_X509_CRL_DIGEST 1

to the config.h that was generated by cmake, the one in (builddir)/packages/ssl.

Sure, but if the problem is unrelated it is better to start a new topic.

This does get defined in my builds. Considering this is only one of the many tests to figure out the OpenSSL details I suspect that somehow there are two OpenSSL versions on your system and configuring uses a different one than the actual compilation. You might be able to figure out something from the CMake log files in the toplevel CMakefiles directory.

I think you were right, I reinstalled the rtools, now the problem went away.

Edit: Oh no, it didn’t :frowning: