Lindacoin / Linda

MIT License
42 stars 51 forks source link

Makefile:2001: recipe for target 'build/key.o' failed #7

Closed DemonRx closed 6 years ago

DemonRx commented 7 years ago
src/key.cpp:29:5: error: ‘secp256k1_context_t’ does not name a type
     secp256k1_context_t* ctx;
     ^
src/key.cpp: In constructor ‘{anonymous}::CSecp256k1Init::CSecp256k1Init()’:
src/key.cpp:31:9: error: ‘ctx’ was not declared in this scope
         ctx = secp256k1_context_create(SECP256K1_CONTEXT_SIGN);
         ^
src/key.cpp: In destructor ‘{anonymous}::CSecp256k1Init::~CSecp256k1Init()’:
src/key.cpp:34:35: error: ‘ctx’ was not declared in this scope
         secp256k1_context_destroy(ctx);
                                   ^
src/key.cpp: In member function ‘bool CKey::SetPrivKey(const CPrivKey&, bool)’:
src/key.cpp:471:61: error: ‘class {anonymous}::CSecp256k1Init’ has no member named ‘ctx’
     if (!secp256k1_ec_privkey_import(instance_of_csecp256k1.ctx, (unsigned char*)begin(), &privkey[0], privkey.size()))
                                                             ^
src/key.cpp:471:118: error: ‘secp256k1_ec_privkey_import’ was not declared in this scope
     if (!secp256k1_ec_privkey_import(instance_of_csecp256k1.ctx, (unsigned char*)begin(), &privkey[0], privkey.size()))
                                                                                                                      ^
src/key.cpp: In member function ‘CPrivKey CKey::GetPrivKey() const’:
src/key.cpp:490:66: error: ‘class {anonymous}::CSecp256k1Init’ has no member named ‘ctx’
     int ret = secp256k1_ec_privkey_export(instance_of_csecp256k1.ctx, begin(), (unsigned char*)&privkey[0], &privkeylen, fCompressed);
                                                                  ^
src/key.cpp:490:133: error: ‘secp256k1_ec_privkey_export’ was not declared in this scope
     int ret = secp256k1_ec_privkey_export(instance_of_csecp256k1.ctx, begin(), (unsigned char*)&privkey[0], &privkeylen, fCompressed);
                                                                                                                                     ^
src/key.cpp: In member function ‘CPubKey CKey::GetPubKey() const’:
src/key.cpp:506:65: error: ‘class {anonymous}::CSecp256k1Init’ has no member named ‘ctx’
     int ret = secp256k1_ec_pubkey_create(instance_of_csecp256k1.ctx, (unsigned char*)pubkey.begin(), &clen, begin(), fCompressed);
                                                                 ^
src/key.cpp: In member function ‘bool CKey::Sign(const uint256&, std::vector<unsigned char>&) const’:
src/key.cpp:528:57: error: ‘class {anonymous}::CSecp256k1Init’ has no member named ‘ctx’
         if (secp256k1_ecdsa_sign(instance_of_csecp256k1.ctx, hash.begin(), (unsigned char*)&vchSig[0], &nSigLen, begin(),  secp256k1_nonce_function_rfc6979, NULL))
                                                         ^
src/key.cpp: In member function ‘bool CKey::SignCompact(const uint256&, std::vector<unsigned char>&) const’:
src/key.cpp:552:75: error: ‘class {anonymous}::CSecp256k1Init’ has no member named ‘ctx’
         if (int ret = secp256k1_ecdsa_sign_compact(instance_of_csecp256k1.ctx, hash.begin(), &vchSig[1], begin(), secp256k1_nonce_function_rfc6979, NULL, &rec))
                                                                           ^
src/key.cpp:552:159: error: ‘secp256k1_ecdsa_sign_compact’ was not declared in this scope
         if (int ret = secp256k1_ecdsa_sign_compact(instance_of_csecp256k1.ctx, hash.begin(), &vchSig[1], begin(), secp256k1_nonce_function_rfc6979, NULL, &rec))
                                                                                                                                                               ^
src/key.cpp:552:17: warning: unused variable ‘ret’ [-Wunused-variable]
         if (int ret = secp256k1_ecdsa_sign_compact(instance_of_csecp256k1.ctx, hash.begin(), &vchSig[1], begin(), secp256k1_nonce_function_rfc6979, NULL, &rec))
                 ^
src/key.cpp: In member function ‘bool CKey::Load(CPrivKey&, CPubKey&, bool)’:
src/key.cpp:568:61: error: ‘class {anonymous}::CSecp256k1Init’ has no member named ‘ctx’
     if (!secp256k1_ec_privkey_import(instance_of_csecp256k1.ctx, (unsigned char*)begin(), &privkey[0], privkey.size()))
                                                             ^
src/key.cpp:568:118: error: ‘secp256k1_ec_privkey_import’ was not declared in this scope
     if (!secp256k1_ec_privkey_import(instance_of_csecp256k1.ctx, (unsigned char*)begin(), &privkey[0], privkey.size()))
                                                                                                                      ^
src/key.cpp: In member function ‘bool CPubKey::VerifyCompact(const uint256&, const std::vector<unsigned char>&) const’:
src/key.cpp:632:10: warning: unused variable ‘fComp’ [-Wunused-variable]
     bool fComp = IsCompressed();
          ^
src/key.cpp: In member function ‘bool CPubKey::IsFullyValid() const’:
src/key.cpp:654:60: error: ‘class {anonymous}::CSecp256k1Init’ has no member named ‘ctx’
     if (!secp256k1_ec_pubkey_verify(instance_of_csecp256k1.ctx, begin(), size()))
                                                            ^
src/key.cpp:654:80: error: ‘secp256k1_ec_pubkey_verify’ was not declared in this scope
     if (!secp256k1_ec_pubkey_verify(instance_of_csecp256k1.ctx, begin(), size()))
                                                                                ^
src/key.cpp: In member function ‘bool CPubKey::Decompress()’:
src/key.cpp:669:69: error: ‘class {anonymous}::CSecp256k1Init’ has no member named ‘ctx’
     int ret = secp256k1_ec_pubkey_decompress(instance_of_csecp256k1.ctx, (unsigned char*)begin(), &clen);
                                                                     ^
src/key.cpp:669:104: error: ‘secp256k1_ec_pubkey_decompress’ was not declared in this scope
     int ret = secp256k1_ec_pubkey_decompress(instance_of_csecp256k1.ctx, (unsigned char*)begin(), &clen);
                                                                                                        ^
src/key.cpp: In member function ‘bool CKey::Derive(CKey&, unsigned char*, unsigned int, const unsigned char*) const’:
src/key.cpp:711:70: error: ‘class {anonymous}::CSecp256k1Init’ has no member named ‘ctx’
     bool ret = secp256k1_ec_privkey_tweak_add(instance_of_csecp256k1.ctx, (unsigned char*)keyChild.begin(), out);
                                                                      ^
src/key.cpp: In member function ‘bool CPubKey::Derive(CPubKey&, unsigned char*, unsigned int, const unsigned char*) const’:
src/key.cpp:730:69: error: ‘class {anonymous}::CSecp256k1Init’ has no member named ‘ctx’
     bool ret = secp256k1_ec_pubkey_tweak_add(instance_of_csecp256k1.ctx, (unsigned char*)pubkeyChild.begin(), pubkeyChild.size(), out);
                                                                     ^
Makefile:2001: recipe for target 'build/key.o' failed
make: *** [build/key.o] Error 1
make: *** Waiting for unfinished jobs....
RangaBoom commented 7 years ago

Try This, You want to remove secp256k1 from Linda/src then rebuild it inside.

cd Linda/src

rm -r secp256k1

git clone http://www.github.com/bitcoin/secp256k1

cd secp256k1

git checkout a1d5ae1

./autogen.sh

./configure --enable-module-recovery

make

make install

DemonRx commented 7 years ago

Good news, it finally compiled the -qt, the bad news when trying to run it:

[libsecp256k1] illegal argument: Invalid flags
Aborted (core dumped)

Also the --enable-module-recovery option doesn't exist:

configure: WARNING: unrecognized options: --enable-module-recovery

However there's another secp256k1 repo that contains such option (but this one hasn't worked for me):

https://github.com/bitcoin-core/secp256k1

unless I need to figure out which commit to checkout on it?

Thank you for helping with this. just need a lil more fidgeting to get it working it seems...

DemonRx commented 7 years ago

What also makes even less sense, is that the daemon (Lindag) compiles without issue as-is or any changes to the src, it's only the -qt that's having the problem...

Fibroblasto commented 6 years ago

I had the problem D3m0nKingx reported in the beginning of this thread. I tried the solution suggested by RangaBoom, and that problem looks solved, but now I've got this error:

src/masternode.cpp: In function ‘void ProcessMessageMasternode(CNode, std::__cxx11::string&, CDataStream&)’: src/masternode.cpp:161:26: error: cannot convert ‘bool’ to ‘bool’ in initialization bool pfMissingInputs = false; ^~~~~ src/masternode.cpp: In member function ‘void CMasterNode::Check()’: src/masternode.cpp:602:33: error: cannot convert ‘bool’ to ‘bool’ in initialization bool pfMissingInputs = false; ^~~~~ src/darksend.cpp: In member function ‘bool CDarkSendPool::IsCollateralValid(const CTransaction&)’: src/darksend.cpp:977:29: error: cannot convert ‘bool’ to ‘bool’ in initialization bool* pfMissingInputs = false; ^~~~~ Makefile:3758: recipe for target 'build/masternode.o' failed make: [build/masternode.o] Error 1 make: Waiting for unfinished jobs.... Makefile:3843: recipe for target 'build/darksend.o' failed make: *** [build/darksend.o] Error 1

mccomber commented 6 years ago

Fibroblasto, in each .cpp file that fails, find:

bool* pfMissingInputs = false;

and replace with:

bool* pfMissingInputs;

nisanb commented 6 years ago

Thank you @mccomber .