i try to compile on Ubuntu 16.04 but display this error at the and of make.
bignum.hpp:63:24: error: invalid use of incomplete type ‘BIGNUM {aka struct bignum_st}’
class CBigNum : public BIGNUM
^
In file included from /usr/local/include/openssl/bn.h:32:0,
from bignum.hpp:20,
from bignum.cpp:8:
/usr/local/include/openssl/ossl_typ.h:80:16: note: forward declaration of ‘BIGNUM {aka struct bignum_st}’
typedef struct bignum_st BIGNUM;
^
In file included from bignum.cpp:8:0:
bignum.hpp: In constructor ‘CBigNum::CBigNum()’:
bignum.hpp:68:21: error: ‘BN_init’ was not declared in this scope
BN_init(this);
^
bignum.hpp: In copy constructor ‘CBigNum::CBigNum(const CBigNum&)’:
bignum.hpp:73:21: error: ‘BN_init’ was not declared in this scope
BN_init(this);
^
bignum.hpp:74:30: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘1’ to ‘BIGNUM* BN_copy(BIGNUM*, const BIGNUM*)’
if (!BN_copy(this, &b))
^
bignum.hpp:76:31: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘1’ to ‘void BN_clear_free(BIGNUM*)’
BN_clear_free(this);
^
bignum.hpp: In member function ‘CBigNum& CBigNum::operator=(const CBigNum&)’:
bignum.hpp:83:30: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘1’ to ‘BIGNUM* BN_copy(BIGNUM*, const BIGNUM*)’
if (!BN_copy(this, &b))
^
bignum.hpp: In destructor ‘CBigNum::~CBigNum()’:
bignum.hpp:90:27: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘1’ to ‘void BN_clear_free(BIGNUM*)’
BN_clear_free(this);
^
bignum.hpp: In constructor ‘CBigNum::CBigNum(signed char)’:
bignum.hpp:94:47: error: ‘BN_init’ was not declared in this scope
CBigNum(signed char n) { BN_init(this); if (n >= 0) setulong(n); else setint64(n); }
^
bignum.hpp: In constructor ‘CBigNum::CBigNum(short int)’:
bignum.hpp:95:47: error: ‘BN_init’ was not declared in this scope
CBigNum(short n) { BN_init(this); if (n >= 0) setulong(n); else setint64(n); }
^
bignum.hpp: In constructor ‘CBigNum::CBigNum(int)’:
bignum.hpp:96:47: error: ‘BN_init’ was not declared in this scope
CBigNum(int n) { BN_init(this); if (n >= 0) setulong(n); else setint64(n); }
^
bignum.hpp: In constructor ‘CBigNum::CBigNum(long int)’:
bignum.hpp:97:47: error: ‘BN_init’ was not declared in this scope
CBigNum(long n) { BN_init(this); if (n >= 0) setulong(n); else setint64(n); }
^
bignum.hpp: In constructor ‘CBigNum::CBigNum(int64)’:
bignum.hpp:98:47: error: ‘BN_init’ was not declared in this scope
CBigNum(int64 n) { BN_init(this); setint64(n); }
^
bignum.hpp: In constructor ‘CBigNum::CBigNum(unsigned char)’:
bignum.hpp:99:47: error: ‘BN_init’ was not declared in this scope
CBigNum(unsigned char n) { BN_init(this); setulong(n); }
^
bignum.hpp: In constructor ‘CBigNum::CBigNum(short unsigned int)’:
bignum.hpp:100:47: error: ‘BN_init’ was not declared in this scope
CBigNum(unsigned short n) { BN_init(this); setulong(n); }
^
bignum.hpp: In constructor ‘CBigNum::CBigNum(unsigned int)’:
bignum.hpp:101:47: error: ‘BN_init’ was not declared in this scope
CBigNum(unsigned int n) { BN_init(this); setulong(n); }
^
bignum.hpp: In constructor ‘CBigNum::CBigNum(long unsigned int)’:
bignum.hpp:102:47: error: ‘BN_init’ was not declared in this scope
CBigNum(unsigned long n) { BN_init(this); setulong(n); }
^
bignum.hpp: In constructor ‘CBigNum::CBigNum(uint64)’:
bignum.hpp:103:47: error: ‘BN_init’ was not declared in this scope
CBigNum(uint64 n) { BN_init(this); setuint64(n); }
^
bignum.hpp: In constructor ‘CBigNum::CBigNum(uint256)’:
bignum.hpp:104:47: error: ‘BN_init’ was not declared in this scope
explicit CBigNum(uint256 n) { BN_init(this); setuint256(n); }
^
bignum.hpp: In constructor ‘CBigNum::CBigNum(const std::vector&)’:
bignum.hpp:108:21: error: ‘BN_init’ was not declared in this scope
BN_init(this);
^
bignum.hpp: In member function ‘void CBigNum::setulong(long unsigned int)’:
bignum.hpp:114:33: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘1’ to ‘int BN_set_word(BIGNUM*, long unsigned int)’
if (!BN_set_word(this, n))
^
bignum.hpp: In member function ‘long unsigned int CBigNum::getulong() const’:
bignum.hpp:120:48: error: cannot convert ‘const CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘long unsigned int BN_get_word(const BIGNUM*)’
return (unsigned long) BN_get_word(this);
^
bignum.hpp: In member function ‘unsigned int CBigNum::getuint() const’:
bignum.hpp:125:47: error: cannot convert ‘const CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘long unsigned int BN_get_word(const BIGNUM*)’
return (unsigned int) BN_get_word(this);
^
bignum.hpp: In member function ‘int CBigNum::getint() const’:
bignum.hpp:130:59: error: cannot convert ‘const CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘long unsigned int BN_get_word(const BIGNUM*)’
unsigned long n = (unsigned long) BN_get_word(this);
^
bignum.hpp:131:33: error: cannot convert ‘const CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘int BN_is_negative(const BIGNUM*)’
if (!BN_is_negative(this))
^
In file included from bignum.cpp:8:0:
bignum.hpp: In member function ‘void CBigNum::setint64(int64)’:
bignum.hpp:179:45: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘3’ to ‘BIGNUM* BN_mpi2bn(const unsigned char*, int, BIGNUM*)’
BN_mpi2bn(pch, (int) (p - pch), this);
^
bignum.hpp: In member function ‘void CBigNum::setuint64(uint64)’:
bignum.hpp:206:45: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘3’ to ‘BIGNUM* BN_mpi2bn(const unsigned char*, int, BIGNUM*)’
BN_mpi2bn(pch, (int) (p - pch), this);
^
bignum.hpp: In member function ‘void CBigNum::setuint256(uint256)’:
bignum.hpp:234:45: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘3’ to ‘BIGNUM* BN_mpi2bn(const unsigned char*, int, BIGNUM*)’
BN_mpi2bn(pch, (int) (p - pch), this);
^
bignum.hpp: In member function ‘uint256 CBigNum::getuint256() const’:
bignum.hpp:239:50: error: cannot convert ‘const CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘int BN_bn2mpi(const BIGNUM*, unsigned char*)’
unsigned int nSize = BN_bn2mpi(this, NULL);
^
bignum.hpp:243:32: error: cannot convert ‘const CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘int BN_bn2mpi(const BIGNUM*, unsigned char*)’
BN_bn2mpi(this, &vch[0]);
^
bignum.hpp: In member function ‘void CBigNum::setvch(const std::vector&)’:
bignum.hpp:264:52: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘3’ to ‘BIGNUM* BN_mpi2bn(const unsigned char*, int, BIGNUM*)’
BN_mpi2bn(&vch2[0], (int) vch2.size(), this);
^
bignum.hpp: In member function ‘std::vector CBigNum::getvch() const’:
bignum.hpp:269:50: error: cannot convert ‘const CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘int BN_bn2mpi(const BIGNUM*, unsigned char*)’
unsigned int nSize = BN_bn2mpi(this, NULL);
^
bignum.hpp:273:32: error: cannot convert ‘const CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘int BN_bn2mpi(const BIGNUM*, unsigned char*)’
BN_bn2mpi(this, &vch[0]);
^
bignum.hpp: In member function ‘CBigNum& CBigNum::SetCompact(unsigned int)’:
bignum.hpp:309:36: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘1’ to ‘int BN_set_word(BIGNUM*, long unsigned int)’
BN_set_word(this, nWord);
^
bignum.hpp:313:36: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘1’ to ‘int BN_set_word(BIGNUM*, long unsigned int)’
BN_set_word(this, nWord);
^
bignum.hpp:314:46: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘1’ to ‘int BN_lshift(BIGNUM*, const BIGNUM*, int)’
BN_lshift(this, this, 8*(nSize-3));
^
bignum.hpp:316:40: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘1’ to ‘void BN_set_negative(BIGNUM*, int)’
BN_set_negative(this, fNegative);
^
In file included from bignum.hpp:20:0,
from bignum.cpp:8:
bignum.hpp: In member function ‘unsigned int CBigNum::GetCompact() const’:
bignum.hpp:322:30: error: cannot convert ‘const CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘int BN_num_bits(const BIGNUM*)’
unsigned int nSize = BN_num_bytes(this);
^
In file included from bignum.cpp:8:0:
bignum.hpp:325:55: error: cannot convert ‘const CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘long unsigned int BN_get_word(const BIGNUM*)’
nCompact = (unsigned int) BN_get_word(this) << 8*(3-nSize);
^
bignum.hpp:329:45: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘1’ to ‘int BN_rshift(BIGNUM*, const BIGNUM*, int)’
BN_rshift(&bn, this, 8*(nSize-3));
^
bignum.hpp:330:54: error: cannot convert ‘CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘long unsigned int BN_get_word(const BIGNUM*)’
nCompact = (unsigned int) BN_get_word(&bn);
^
bignum.hpp:340:41: error: cannot convert ‘const CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘int BN_is_negative(const BIGNUM*)’
nCompact |= (BN_is_negative(this) ? 0x00800000 : 0);
^
In file included from bignum.cpp:8:0:
bignum.hpp: In member function ‘std::__cxx11::string CBigNum::ToString(int) const’:
bignum.hpp:381:35: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘1’ to ‘void BN_set_negative(BIGNUM*, int)’
BN_set_negative(&bn, false);
^
bignum.hpp:384:29: error: cannot convert ‘CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘int BN_cmp(const BIGNUM*, const BIGNUM*)’
if (BN_cmp(&bn, &bn0) == 0)
^
bignum.hpp:386:32: error: cannot convert ‘CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘int BN_cmp(const BIGNUM*, const BIGNUM*)’
while (BN_cmp(&bn, &bn0) > 0)
^
bignum.hpp:388:54: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘1’ to ‘int BN_div(BIGNUM*, BIGNUM*, const BIGNUM*, const BIGNUM*, BN_CTX*)’
if (!BN_div(&dv, &rem, &bn, &bnBase, pctx))
^
bignum.hpp:394:32: error: cannot convert ‘const CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘int BN_is_negative(const BIGNUM*)’
if (BN_is_negative(this))
^
bignum.hpp: In member function ‘bool CBigNum::operator!() const’:
bignum.hpp:427:31: error: cannot convert ‘const CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘int BN_is_zero(const BIGNUM*)’
return BN_is_zero(this);
^
bignum.hpp: In member function ‘CBigNum& CBigNum::operator+=(const CBigNum&)’:
bignum.hpp:432:35: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘1’ to ‘int BN_add(BIGNUM*, const BIGNUM*, const BIGNUM*)’
if (!BN_add(this, this, &b))
^
bignum.hpp: In member function ‘CBigNum& CBigNum::operator*=(const CBigNum&)’:
bignum.hpp:446:41: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘1’ to ‘int BN_mul(BIGNUM*, const BIGNUM*, const BIGNUM*, BN_CTX*)’
if (!BN_mul(this, this, &b, pctx))
^
bignum.hpp: In member function ‘CBigNum& CBigNum::operator<<=(unsigned int)’:
bignum.hpp:465:41: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘1’ to ‘int BN_lshift(BIGNUM*, const BIGNUM*, int)’
if (!BN_lshift(this, this, shift))
^
bignum.hpp: In member function ‘CBigNum& CBigNum::operator>>=(unsigned int)’:
bignum.hpp:476:28: error: cannot convert ‘CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘int BN_cmp(const BIGNUM*, const BIGNUM*)’
if (BN_cmp(&a, this) > 0)
^
bignum.hpp:482:41: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘1’ to ‘int BN_rshift(BIGNUM*, const BIGNUM*, int)’
if (!BN_rshift(this, this, shift))
^
bignum.hpp: In member function ‘CBigNum& CBigNum::operator++()’:
bignum.hpp:491:47: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘1’ to ‘int BN_add(BIGNUM*, const BIGNUM*, const BIGNUM*)’
if (!BN_add(this, this, BN_value_one()))
^
bignum.hpp: In member function ‘CBigNum& CBigNum::operator--()’:
bignum.hpp:508:45: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘1’ to ‘int BN_sub(BIGNUM*, const BIGNUM*, const BIGNUM*)’
if (!BN_sub(&r, this, BN_value_one()))
^
bignum.hpp: In function ‘const CBigNum operator+(const CBigNum&, const CBigNum&)’:
bignum.hpp:533:27: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘1’ to ‘int BN_add(BIGNUM*, const BIGNUM*, const BIGNUM*)’
if (!BN_add(&r, &a, &b))
^
bignum.hpp: In function ‘const CBigNum operator-(const CBigNum&, const CBigNum&)’:
bignum.hpp:541:27: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘1’ to ‘int BN_sub(BIGNUM*, const BIGNUM*, const BIGNUM*)’
if (!BN_sub(&r, &a, &b))
^
bignum.hpp: In function ‘const CBigNum operator-(const CBigNum&)’:
bignum.hpp:549:43: error: cannot convert ‘CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘int BN_is_negative(const BIGNUM*)’
BN_set_negative(&r, !BN_is_negative(&r));
^
bignum.hpp: In function ‘const CBigNum operator*(const CBigNum&, const CBigNum&)’:
bignum.hpp:557:33: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘1’ to ‘int BN_mul(BIGNUM*, const BIGNUM*, const BIGNUM*, BN_CTX*)’
if (!BN_mul(&r, &a, &b, pctx))
^
bignum.hpp: In function ‘const CBigNum operator/(const CBigNum&, const CBigNum&)’:
bignum.hpp:566:39: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘1’ to ‘int BN_div(BIGNUM*, BIGNUM*, const BIGNUM*, const BIGNUM*, BN_CTX*)’
if (!BN_div(&r, NULL, &a, &b, pctx))
^
In file included from bignum.hpp:20:0,
from bignum.cpp:8:
bignum.hpp: In function ‘const CBigNum operator%(const CBigNum&, const CBigNum&)’:
bignum.hpp:575:10: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘2’ to ‘int BN_div(BIGNUM*, BIGNUM*, const BIGNUM*, const BIGNUM*, BN_CTX*)’
if (!BN_mod(&r, &a, &b, pctx))
^
In file included from bignum.cpp:8:0:
bignum.hpp: In function ‘const CBigNum operator<<(const CBigNum&, unsigned int)’:
bignum.hpp:583:33: error: cannot convert ‘CBigNum*’ to ‘BIGNUM* {aka bignum_st*}’ for argument ‘1’ to ‘int BN_lshift(BIGNUM*, const BIGNUM*, int)’
if (!BN_lshift(&r, &a, shift))
^
bignum.hpp: In function ‘bool operator==(const CBigNum&, const CBigNum&)’:
bignum.hpp:595:83: error: cannot convert ‘const CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘int BN_cmp(const BIGNUM*, const BIGNUM*)’
inline bool operator==(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) == 0); }
^
bignum.hpp: In function ‘bool operator!=(const CBigNum&, const CBigNum&)’:
bignum.hpp:596:83: error: cannot convert ‘const CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘int BN_cmp(const BIGNUM*, const BIGNUM*)’
inline bool operator!=(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) != 0); }
^
bignum.hpp: In function ‘bool operator<=(const CBigNum&, const CBigNum&)’:
bignum.hpp:597:83: error: cannot convert ‘const CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘int BN_cmp(const BIGNUM*, const BIGNUM*)’
inline bool operator<=(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) <= 0); }
^
bignum.hpp: In function ‘bool operator>=(const CBigNum&, const CBigNum&)’:
bignum.hpp:598:83: error: cannot convert ‘const CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘int BN_cmp(const BIGNUM*, const BIGNUM*)’
inline bool operator>=(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) >= 0); }
^
bignum.hpp: In function ‘bool operator<(const CBigNum&, const CBigNum&)’:
bignum.hpp:599:83: error: cannot convert ‘const CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘int BN_cmp(const BIGNUM*, const BIGNUM*)’
inline bool operator<(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) < 0); }
^
bignum.hpp: In function ‘bool operator>(const CBigNum&, const CBigNum&)’:
bignum.hpp:600:83: error: cannot convert ‘const CBigNum*’ to ‘const BIGNUM* {aka const bignum_st*}’ for argument ‘1’ to ‘int BN_cmp(const BIGNUM*, const BIGNUM*)’
inline bool operator>(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) > 0); }