<p>I have been trying to build bitcoin-core on macOS as I am reading the &quot;Mastering Bitcoin&quot; book from Andreas Antonopoulos.</p>
<p>I read the instructions for building the the bitcoin-core on macOS from the <em>doc/build-osx.md</em> file in the bitcoin repository and I installed all the libraries that are needed ( following the build-osx.md file ):</p>
<ol>
<li><code>brew install autoconf automake libtool boost miniupnpc openssl pkg-config protobuf qt</code> ( Also I installed a bunch of other libraries that I hoped would solve the issue, such as <code>sqlite python libevent qrencode</code></li>
<li>The docs say &quot;<em>You should see OpenSSL 1.0.1f 6 Jan 2014.</em>&quot; however now we have version 1.1.1k in 2021 as I am writing this. And also it asked me to do <code>brew link openssl --force</code> which I did.</li>
<li>I installed berkeley-db4, but I did with <code>brew install berkeley-db@4</code> since the link that is provided in the bitcoin docs doesn't work - <code>brew install https://raw.github.com/mxcl/homebrew/master/Library/Formula/berkeley-db4.rb -–without-java </code></li>
<li>I have Xcode and its Command Line Tools</li>
<li>Then I did the <code>./autogen.sh</code> , <code>./configure</code> and <code>make</code>. The <code>./configure</code> went alright, without any errors, however when I type <code>make</code> I get the following errors.</li>
</ol>
<pre><code>/usr/local/include/boost/bind.hpp:36:1: warning: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated. Please use &lt;boost/bind/bind.hpp&gt; + using namespace boost::placeholders, or define BOOST_BIND_GLOBAL_PLACEHOLDERS to retain the current behavior. [-W#pragma-messages]
BOOST_PRAGMA_MESSAGE(
^
/usr/local/include/boost/config/pragma_message.hpp:24:34: note: expanded from macro 'BOOST_PRAGMA_MESSAGE'
# define BOOST_PRAGMA_MESSAGE(x) _Pragma(BOOST_STRINGIZE(message(x)))
                                 ^
&lt;scratch space&gt;:85:2: note: expanded from here
 message(&quot;The practice of declaring the Bind placeholders (_1, _2, ...) &quot; &quot;in the global namespace is deprecated. Please use &quot; &quot;&lt;boost/bind/bind.hpp&gt; + using namespace boost::placeholders, &quot; &quot;or define BOOST_BIND_GLOBAL_PLACEHOLDERS to retain the current behavior.&quot;)
 ^
In file included from bitcoind.cpp:9:
In file included from ./main.h:13:
./bignum.h:56:24: error: base class has incomplete type
class CBigNum : public BIGNUM
                ~~~~~~~^~~~~~
/usr/local/Cellar/openssl@1.1/1.1.1k/include/openssl/ossl_typ.h:80:16: note: forward declaration of 'bignum_st'
typedef struct bignum_st BIGNUM;
               ^
In file included from bitcoind.cpp:9:
In file included from ./main.h:13:
./bignum.h:61:9: error: use of undeclared identifier 'BN_init'
        BN_init(this);
        ^
./bignum.h:66:9: error: use of undeclared identifier 'BN_init'
        BN_init(this);
        ^
./bignum.h:67:14: error: no matching function for call to 'BN_copy'
        if (!BN_copy(this, &amp;b))
             ^~~~~~~
/usr/local/Cellar/openssl@1.1/1.1.1k/include/openssl/bn.h:219:9: note: candidate function not viable: no known conversion from 'CBigNum *' to 'BIGNUM *' (aka 'bignum_st *') for 1st argument
BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b);
        ^
In file included from bitcoind.cpp:9:
In file included from ./main.h:13:
./bignum.h:69:13: error: no matching function for call to 'BN_clear_free'
            BN_clear_free(this);
            ^~~~~~~~~~~~~
/usr/local/Cellar/openssl@1.1/1.1.1k/include/openssl/bn.h:218:6: note: candidate function not viable: no known conversion from 'CBigNum *' to 'BIGNUM *' (aka 'bignum_st *') for 1st argument
void BN_clear_free(BIGNUM *a);
     ^
In file included from bitcoind.cpp:9:
In file included from ./main.h:13:
./bignum.h:76:14: error: no matching function for call to 'BN_copy'
        if (!BN_copy(this, &amp;b))
             ^~~~~~~
/usr/local/Cellar/openssl@1.1/1.1.1k/include/openssl/bn.h:219:9: note: candidate function not viable: no known conversion from 'CBigNum *' to 'BIGNUM *' (aka 'bignum_st *') for 1st argument
BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b);
        ^
In file included from bitcoind.cpp:9:
In file included from ./main.h:13:
./bignum.h:83:9: error: no matching function for call to 'BN_clear_free'
        BN_clear_free(this);
        ^~~~~~~~~~~~~
/usr/local/Cellar/openssl@1.1/1.1.1k/include/openssl/bn.h:218:6: note: candidate function not viable: no known conversion from 'CBigNum *' to 'BIGNUM *' (aka 'bignum_st *') for 1st argument
void BN_clear_free(BIGNUM *a);
     ^
In file included from bitcoind.cpp:9:
In file included from ./main.h:13:
./bignum.h:87:37: error: use of undeclared identifier 'BN_init'
    CBigNum(signed char n)        { BN_init(this); if (n &gt;= 0) setulong(n); else setint64(n); }
                                    ^
./bignum.h:88:37: error: use of undeclared identifier 'BN_init'
    CBigNum(short n)              { BN_init(this); if (n &gt;= 0) setulong(n); else setint64(n); }
                                    ^
./bignum.h:89:37: error: use of undeclared identifier 'BN_init'
    CBigNum(int n)                { BN_init(this); if (n &gt;= 0) setulong(n); else setint64(n); }
                                    ^
./bignum.h:90:37: error: use of undeclared identifier 'BN_init'
    CBigNum(long n)               { BN_init(this); if (n &gt;= 0) setulong(n); else setint64(n); }
                                    ^
./bignum.h:91:37: error: use of undeclared identifier 'BN_init'
    CBigNum(long long n)          { BN_init(this); setint64(n); }
                                    ^
./bignum.h:92:37: error: use of undeclared identifier 'BN_init'
    CBigNum(unsigned char n)      { BN_init(this); setulong(n); }
                                    ^
./bignum.h:93:37: error: use of undeclared identifier 'BN_init'
    CBigNum(unsigned short n)     { BN_init(this); setulong(n); }
                                    ^
./bignum.h:94:37: error: use of undeclared identifier 'BN_init'
    CBigNum(unsigned int n)       { BN_init(this); setulong(n); }
                                    ^
./bignum.h:95:37: error: use of undeclared identifier 'BN_init'
    CBigNum(unsigned long n)      { BN_init(this); setulong(n); }
                                    ^
./bignum.h:96:37: error: use of undeclared identifier 'BN_init'
    CBigNum(unsigned long long n) { BN_init(this); setuint64(n); }
                                    ^
./bignum.h:97:37: error: use of undeclared identifier 'BN_init'
    explicit CBigNum(uint256 n)   { BN_init(this); setuint256(n); }
                                    ^
./bignum.h:101:9: error: use of undeclared identifier 'BN_init'
        BN_init(this);
        ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
1 warning and 20 errors generated.
make[3]: *** [bitcoind.o] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all] Error 2
make: *** [all-recursive] Error 1
</code></pre>
<p>I thought it was something with the openssl version so I have been trying to fix it by installing an older version but <em>brew</em> gave me errors everytime I tried something new. Now I have the latest version of openssl which is <strong>1.1.1k</strong>. I am not sure what I am doing wrong.</p>
<p>I would appreciate any help I can get. Thanks</p>

CC BY-SA 4.0
2021-08-24T22:53:05.523Z
What version of Bitcoin Core are you trying to build? Openssl is no longer a dependency since 0.20
Ava Chow
CC BY-SA 4.0
2021-08-25T11:08:50.480Z
@AndrewChow I am trying to build v0.9.5rc1
Alex  Matei
CC BY-SA 4.0
2021-08-25T11:21:51.070Z
I switched to v22.0rc2 and the problem seems to have been fixed. Thank you.
Alex  Matei
<bitcoin-core><mac><compiling><openssl><make>
Openssl errors when building the bitcoin-core on macOS
Alex  Matei
# Openssl errors when building the bitcoin-core on macOS

(Asked by: username_0 on 2021-08-24)

I have been trying to build bitcoin-core on macOS as I am reading the "Mastering Bitcoin" book from Andreas Antonopoulos.
I read the instructions for building the the bitcoin-core on macOS from the doc/build-osx.md file in the bitcoin repository and I installed all the libraries that are needed ( following the build-osx.md file ):

brew install autoconf automake libtool boost miniupnpc openssl pkg-config protobuf qt ( Also I installed a bunch of other libraries that I hoped would solve the issue, such as sqlite python libevent qrencode
The docs say "You should see OpenSSL 1.0.1f 6 Jan 2014." however now we have version 1.1.1k in 2021 as I am writing this. And also it asked me to do brew link openssl --force which I did.
I installed berkeley-db4, but I did with brew install berkeley-db@4 since the link that is provided in the bitcoin docs doesn't work - brew install https://raw.github.com/mxcl/homebrew/master/Library/Formula/berkeley-db4.rb -–without-java 
I have Xcode and its Command Line Tools
Then I did the ./autogen.sh , ./configure and make. The ./configure went alright, without any errors, however when I type make I get the following errors.

/usr/local/include/boost/bind.hpp:36:1: warning: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated. Please use  + using namespace boost::placeholders, or define BOOST_BIND_GLOBAL_PLACEHOLDERS to retain the current behavior. [-W#pragma-messages]
BOOST_PRAGMA_MESSAGE(
^
/usr/local/include/boost/config/pragma_message.hpp:24:34: note: expanded from macro 'BOOST_PRAGMA_MESSAGE'
# define BOOST_PRAGMA_MESSAGE(x) _Pragma(BOOST_STRINGIZE(message(x)))
                                 ^
:85:2: note: expanded from here
 message("The practice of declaring the Bind placeholders (_1, _2, ...) " "in the global namespace is deprecated. Please use " " + using namespace boost::placeholders, " "or define BOOST_BIND_GLOBAL_PLACEHOLDERS to retain the current behavior.")
 ^
In file included from bitcoind.cpp:9:
In file included from ./main.h:13:
./bignum.h:56:24: error: base class has incomplete type
class CBigNum : public BIGNUM
                ~~~~~~~^~~~~~
/usr/local/Cellar/openssl@1.1/1.1.1k/include/openssl/ossl_typ.h:80:16: note: forward declaration of 'bignum_st'
typedef struct bignum_st BIGNUM;
               ^
In file included from bitcoind.cpp:9:
In file included from ./main.h:13:
./bignum.h:61:9: error: use of undeclared identifier 'BN_init'
        BN_init(this);
        ^
./bignum.h:66:9: error: use of undeclared identifier 'BN_init'
        BN_init(this);
        ^
./bignum.h:67:14: error: no matching function for call to 'BN_copy'
        if (!BN_copy(this, &b))
             ^~~~~~~
/usr/local/Cellar/openssl@1.1/1.1.1k/include/openssl/bn.h:219:9: note: candidate function not viable: no known conversion from 'CBigNum *' to 'BIGNUM *' (aka 'bignum_st *') for 1st argument
BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b);
        ^
In file included from bitcoind.cpp:9:
In file included from ./main.h:13:
./bignum.h:69:13: error: no matching function for call to 'BN_clear_free'
            BN_clear_free(this);
            ^~~~~~~~~~~~~
/usr/local/Cellar/openssl@1.1/1.1.1k/include/openssl/bn.h:218:6: note: candidate function not viable: no known conversion from 'CBigNum *' to 'BIGNUM *' (aka 'bignum_st *') for 1st argument
void BN_clear_free(BIGNUM *a);
     ^
In file included from bitcoind.cpp:9:
In file included from ./main.h:13:
./bignum.h:76:14: error: no matching function for call to 'BN_copy'
        if (!BN_copy(this, &b))
             ^~~~~~~
/usr/local/Cellar/openssl@1.1/1.1.1k/include/openssl/bn.h:219:9: note: candidate function not viable: no known conversion from 'CBigNum *' to 'BIGNUM *' (aka 'bignum_st *') for 1st argument
BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b);
        ^
In file included from bitcoind.cpp:9:
In file included from ./main.h:13:
./bignum.h:83:9: error: no matching function for call to 'BN_clear_free'
        BN_clear_free(this);
        ^~~~~~~~~~~~~
/usr/local/Cellar/openssl@1.1/1.1.1k/include/openssl/bn.h:218:6: note: candidate function not viable: no known conversion from 'CBigNum *' to 'BIGNUM *' (aka 'bignum_st *') for 1st argument
void BN_clear_free(BIGNUM *a);
     ^
In file included from bitcoind.cpp:9:
In file included from ./main.h:13:
./bignum.h:87:37: error: use of undeclared identifier 'BN_init'
    CBigNum(signed char n)        { BN_init(this); if (n >= 0) setulong(n); else setint64(n); }
                                    ^
./bignum.h:88:37: error: use of undeclared identifier 'BN_init'
    CBigNum(short n)              { BN_init(this); if (n >= 0) setulong(n); else setint64(n); }
                                    ^
./bignum.h:89:37: error: use of undeclared identifier 'BN_init'
    CBigNum(int n)                { BN_init(this); if (n >= 0) setulong(n); else setint64(n); }
                                    ^
./bignum.h:90:37: error: use of undeclared identifier 'BN_init'
    CBigNum(long n)               { BN_init(this); if (n >= 0) setulong(n); else setint64(n); }
                                    ^
./bignum.h:91:37: error: use of undeclared identifier 'BN_init'
    CBigNum(long long n)          { BN_init(this); setint64(n); }
                                    ^
./bignum.h:92:37: error: use of undeclared identifier 'BN_init'
    CBigNum(unsigned char n)      { BN_init(this); setulong(n); }
                                    ^
./bignum.h:93:37: error: use of undeclared identifier 'BN_init'
    CBigNum(unsigned short n)     { BN_init(this); setulong(n); }
                                    ^
./bignum.h:94:37: error: use of undeclared identifier 'BN_init'
    CBigNum(unsigned int n)       { BN_init(this); setulong(n); }
                                    ^
./bignum.h:95:37: error: use of undeclared identifier 'BN_init'
    CBigNum(unsigned long n)      { BN_init(this); setulong(n); }
                                    ^
./bignum.h:96:37: error: use of undeclared identifier 'BN_init'
    CBigNum(unsigned long long n) { BN_init(this); setuint64(n); }
                                    ^
./bignum.h:97:37: error: use of undeclared identifier 'BN_init'
    explicit CBigNum(uint256 n)   { BN_init(this); setuint256(n); }
                                    ^
./bignum.h:101:9: error: use of undeclared identifier 'BN_init'
        BN_init(this);
        ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
1 warning and 20 errors generated.
make[3]: *** [bitcoind.o] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all] Error 2
make: *** [all-recursive] Error 1

I thought it was something with the openssl version so I have been trying to fix it by installing an older version but brew gave me errors everytime I tried something new. Now I have the latest version of openssl which is 1.1.1k. I am not sure what I am doing wrong.
I would appreciate any help I can get. Thanks

**Tags:** bitcoin-core, mac, compiling, openssl, make

> **Comments:**
> **username_1**: What version of Bitcoin Core are you trying to build? Openssl is no longer a dependency since 0.20  
> **username_0**: @AndrewChow I am trying to build v0.9.5rc1  
> **username_0**: I switched to v22.0rc2 and the problem seems to have been fixed. Thank you.  

---

## 0 answers

