'BerkleyDB doesn't Install on Ubuntu

I'm currently trying to install Berkley Db. Following the documentation when I make, I hit the following error. There is nothing online I can find about this problem:

../src/repmgr/repmgr_net.c: In function '__repmgr_set_ssl_ctx':
../src/repmgr/repmgr_net.c:2897:6: error: 'repmgr_ssl_mutex_arr' undeclared (first use in this function); did you mean '__repmgr_ssl_readv'?
  if (repmgr_ssl_mutex_arr != NULL) {
      ^~~~~~~~~~~~~~~~~~~~
      __repmgr_ssl_readv
../src/repmgr/repmgr_net.c:2897:6: note: each undeclared identifier is reported only once for each function it appears in
Makefile:2795: recipe for target 'repmgr_net.lo' failed
make: *** [repmgr_net.lo] Error 1


Solution 1:[1]

I was able to get it to build with some small tweaks.

--- orig_repmgr_net.c   2018-07-17 18:38:14.071591439 -0500
+++ repmgr_net.c    2018-07-17 18:36:40.302562092 -0500
@@ -2894,6 +2894,7 @@
    if (ssl_ctx)
        SSL_CTX_free(ssl_ctx);

+#if OPENSSL_VERSION_NUMBER < 0x10100000L
    if (repmgr_ssl_mutex_arr != NULL) {
        for (i = 0; i < CRYPTO_num_locks(); i++) {
            if (repmgr_ssl_mutex_arr[i] != NULL)
@@ -2902,6 +2903,7 @@

        repmgr_ssl_mutex_arr = NULL;
    }
+#endif

    return (1);
 }

Hope that helps.

Solution 2:[2]

Maybe because your OPENSSL_VERSION_NUMBER > 0x10100000L; Like this :

#if OPENSSL_VERSION_NUMBER < 0x10100000L
    if (repmgr_ssl_mutex_arr != NULL) {
            for (i = 0; i < CRYPTO_num_locks(); i++) {
                    if (repmgr_ssl_mutex_arr[i] != NULL)
                            __repmgr_destroy_mutex(env, repmgr_ssl_mutex_arr[i]);
            }

            repmgr_ssl_mutex_arr = NULL;
    }
#endif

Just for an example,you can find your openssl version in this c file;

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 coleifer
Solution 2 Dharman