<p>This is due to some <strong>incompatibility</strong> between Bitcoin-Core 0.13 (and below) with <strong>openSSL 1.1</strong>. openSSL 1.1 has some significant API changes: <a href="https://wiki.openssl.org/index.php/1.1_API_Changes" rel="nofollow noreferrer">https://wiki.openssl.org/index.php/1.1_API_Changes</a></p>

<p>The pull request (patch) #9326 should fix this problem (will very likely be in 0.14).
<a href="https://github.com/bitcoin/bitcoin/pull/9326" rel="nofollow noreferrer">https://github.com/bitcoin/bitcoin/pull/9326</a></p>

<p>Until this has been resolved, you should use an openSSL version below 1.1.</p>

<p><strong>EDIT: this has been fixed in the bitcoin-core's MASTER branch</strong></p>

CC BY-SA 3.0
2016-12-12T14:53:03.250Z
I had to make changes to the file `src/qt/paymentrequestplus.cpp` similar to those of `src/wallet/test/crypto_tests.cpp` in order for it to compile.
Sven Williamson
CC BY-SA 3.0
2016-12-12T15:03:58.550Z
Good point, wasn't aware that you are compiling with the GUI.
Jonas Schnelli
CC BY-SA 3.0
2016-12-12T15:08:46.990Z
Otherwise the build is successful (albeit with the remaining `secp256k1` error).
Sven Williamson
CC BY-SA 3.0
2016-12-15T07:58:59.447Z
This is now fixed in the master branch of bitcoin core
Jonas Schnelli
CC BY-SA 3.0
2016-12-16T20:06:45.970Z
Yes, master branch builds perfectly. `make check` successful. Thank you !
Sven Williamson
CC BY-SA 3.0
2016-12-12T08:19:18.450Z
2016-12-15T07:58:47.287Z
2016-12-15T07:58:47.287Z
Jonas Schnelli
<p>I have recently set up a new machine on debian stretch:</p>

<pre><code>$ uname -a
Linux front 4.8.0-1-amd64 #1 SMP Debian 4.8.7-1 (2016-11-13) x86_64 GNU/Linux
</code></pre>

<p>I am now attempting to install <code>bitcoind</code>. I have already set up a directory <code>db4</code> in my build directory for the Berkeley database version <code>4.8.30</code>. I have installed all the dependencies as per <code>doc/build-unix</code>, including <code>boost</code> from the distribution:</p>

<pre><code>$ sudo apt-get install libboost-all-dev
$ apt-cache show libboost-all-dev
Package: libboost-all-dev
Source: boost-defaults
Version: 1.62.0.1
...

$ ./autogen.sh
...

$ ./configure LDFLAGS="-L..bitcoin/db4/lib/" CPPFLAGS="-I..bitcoin/db4/include/"
...

$ make
...
CXX      wallet/test/test_test_bitcoin-wallet_tests.o
CXX      wallet/test/test_test_bitcoin-crypto_tests.o
wallet/test/crypto_tests.cpp: In function ‘bool wallet_crypto::OldEncrypt(
const CKeyingMaterial&amp;, std::vector&lt;unsigned char&gt;&amp;, const unsigned
char*, const unsigned char*)’:
wallet/test/crypto_tests.cpp:45:20: error: aggregate ‘EVP_CIPHER_CTX ctx’
has incomplete type and cannot be defined
EVP_CIPHER_CTX ctx;
                ^~~
wallet/test/crypto_tests.cpp: In function ‘bool wallet_crypto::OldDecrypt(
const std::vector&lt;unsigned char&gt;&amp;, CKeyingMaterial&amp;, const unsigned
char*, const unsigned char*)’:
wallet/test/crypto_tests.cpp:69:20: error: aggregate ‘EVP_CIPHER_CTX ctx’
has incomplete type and cannot be defined
EVP_CIPHER_CTX ctx;
                ^~~
Makefile:8232: recipe for target 'wallet/test/test_test_bitcoin 
crypto_tests.o' failed
make[2]: *** [wallet/test/test_test_bitcoin-crypto_tests.o] Error 1
make[2]: Leaving directory '/home/john/Libs/bitcoin/src'
Makefile:8370: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/john/Libs/bitcoin/src'
Makefile:680: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1
</code></pre>

<p>Any suggestion is gratefully appreciated.</p>

<p><strong>EDIT:</strong> adding the option <code>--disable-wallet</code> to <code>configure</code> leads to a successful build.</p>

<p><strong>EDIT2:</strong> however, even with the --disable-wallet , the command <code>make check</code> fails with:</p>

<pre><code>make[4]: Entering directory '/home/john/Libs/bitcoin/src/secp256k1'
  CC       src/tests-tests.o
src/tests.c: In function ‘test_ecdsa_der_parse’:
src/tests.c:3561:52: error: dereferencing pointer to incomplete type
‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
valid_openssl = !BN_is_negative(sig_openssl-&gt;r) &amp;&amp;
!BN_is_negative(sig_openssl-&gt;s) &amp;&amp; BN_num_bits(sig_openssl-&gt;r) &gt; 0 &amp;&amp;
BN_num_bits(sig_openssl-&gt;r) &lt;= 256 &amp;&amp; BN_num_bits(sig_openssl-&gt;s) &gt; 0 &amp;&amp;
BN_num_bits(sig_openssl-&gt;s) &lt;= 256;
</code></pre>

<p>This error relating to the C library <code>secp256k1</code> on <code>debian stretch</code> has already been reported on <a href="https://bitcoin.stackexchange.com/questions/49937/cannot-build-secp256k1-c-library-on-debian-stretch">this post</a> and it seems to be related to some <code>openssl</code> API change (a work around put forward by Andrew Poelstra is to configure secp256k1 with the option <code>--enable-openssl-tests=no</code>. However, this is not an option available for <code>bitcoind</code> configuration)</p>

<bitcoind><bitcoin-core>
Failing to build bitcoin-core v0.13.1 on debian stretch
Sven Williamson
# Failing to build bitcoin-core v0.13.1 on debian stretch

(Asked by: username_0 on 2016-12-10)

I have recently set up a new machine on debian stretch:

```
$ uname -a
Linux front 4.8.0-1-amd64 #1 SMP Debian 4.8.7-1 (2016-11-13) x86_64 GNU/Linux

```

I am now attempting to install `bitcoind`. I have already set up a directory `db4` in my build directory for the Berkeley database version `4.8.30`. I have installed all the dependencies as per `doc/build-unix`, including `boost` from the distribution:

```
$ sudo apt-get install libboost-all-dev
$ apt-cache show libboost-all-dev
Package: libboost-all-dev
Source: boost-defaults
Version: 1.62.0.1
...

$ ./autogen.sh
...

$ ./configure LDFLAGS="-L..bitcoin/db4/lib/" CPPFLAGS="-I..bitcoin/db4/include/"
...

$ make
...
CXX      wallet/test/test_test_bitcoin-wallet_tests.o
CXX      wallet/test/test_test_bitcoin-crypto_tests.o
wallet/test/crypto_tests.cpp: In function ‘bool wallet_crypto::OldEncrypt(
const CKeyingMaterial&, std::vector<unsigned char>&, const unsigned
char*, const unsigned char*)’:
wallet/test/crypto_tests.cpp:45:20: error: aggregate ‘EVP_CIPHER_CTX ctx’
has incomplete type and cannot be defined
EVP_CIPHER_CTX ctx;
                ^~~
wallet/test/crypto_tests.cpp: In function ‘bool wallet_crypto::OldDecrypt(
const std::vector<unsigned char>&, CKeyingMaterial&, const unsigned
char*, const unsigned char*)’:
wallet/test/crypto_tests.cpp:69:20: error: aggregate ‘EVP_CIPHER_CTX ctx’
has incomplete type and cannot be defined
EVP_CIPHER_CTX ctx;
                ^~~
Makefile:8232: recipe for target 'wallet/test/test_test_bitcoin 
crypto_tests.o' failed
make[2]: *** [wallet/test/test_test_bitcoin-crypto_tests.o] Error 1
make[2]: Leaving directory '/home/john/Libs/bitcoin/src'
Makefile:8370: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/john/Libs/bitcoin/src'
Makefile:680: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

```

Any suggestion is gratefully appreciated.

**EDIT:** adding the option `--disable-wallet` to `configure` leads to a successful build.

**EDIT2:** however, even with the --disable-wallet , the command `make check` fails with:

```
make[4]: Entering directory '/home/john/Libs/bitcoin/src/secp256k1'
  CC       src/tests-tests.o
src/tests.c: In function ‘test_ecdsa_der_parse’:
src/tests.c:3561:52: error: dereferencing pointer to incomplete type
‘ECDSA_SIG {aka struct ECDSA_SIG_st}’
valid_openssl = !BN_is_negative(sig_openssl->r) &&
!BN_is_negative(sig_openssl->s) && BN_num_bits(sig_openssl->r) > 0 &&
BN_num_bits(sig_openssl->r) <= 256 && BN_num_bits(sig_openssl->s) > 0 &&
BN_num_bits(sig_openssl->s) <= 256;

```

This error relating to the C library `secp256k1` on `debian stretch` has already been reported on [this post](https://bitcoin.stackexchange.com/questions/49937/cannot-build-secp256k1-c-library-on-debian-stretch) and it seems to be related to some `openssl` API change (a work around put forward by Andrew Poelstra is to configure secp256k1 with the option `--enable-openssl-tests=no`. However, this is not an option available for `bitcoind` configuration)

**Tags:** bitcoind, bitcoin-core


---

## 1 answers

### Answer by username_1 on 2016-12-12. Score: 4 | Accepted answer

This is due to some **incompatibility** between Bitcoin-Core 0.13 (and below) with **openSSL 1.1**. openSSL 1.1 has some significant API changes: <https://wiki.openssl.org/index.php/1.1_API_Changes>

The pull request (patch) #9326 should fix this problem (will very likely be in 0.14).
<https://github.com/bitcoin/bitcoin/pull/9326>

Until this has been resolved, you should use an openSSL version below 1.1.

**EDIT: this has been fixed in the bitcoin-core's MASTER branch**

> **Comments:**
> **username_0**: I had to make changes to the file `src/qt/paymentrequestplus.cpp` similar to those of `src/wallet/test/crypto_tests.cpp` in order for it to compile.  
> **username_1**: Good point, wasn't aware that you are compiling with the GUI.  
> **username_0**: Otherwise the build is successful (albeit with the remaining `secp256k1` error).  
> **username_1**: This is now fixed in the master branch of bitcoin core  
> **username_0**: Yes, master branch builds perfectly. `make check` successful. Thank you !  

---

