PirateNetwork / pirate

Pirate Chain (ARRR) - Untraceable, Anonymous, Private Cryptocurrency
https://piratechain.com
Other
112 stars 27 forks source link

Can't compile, missing <stdexcept> in crypto/equihash.h #34

Closed troubled-sea closed 3 years ago

troubled-sea commented 3 years ago

I wasn't able to compile following the README.md steps on Debian GNU/Linux ver. 11 with 5.10 Kernel, GCC 10.2.1 20210110

I get this:

mv -f crypto/.deps/libverus_portable_crypto_a-haraka_portable.Tpo crypto/.deps/libverus_portable_crypto_a-haraka_portable.Po /src/pirate.cli/pirate-5.0.0/depends/x86_64-unknown-linux-gnu/share/../native/bin/ccache g++ -m64 -std=c++11 -DHAVE_CONFIG_H -I. -I../src/config -DMULTICORE -fopenmp -fPIC -DBINARY_OUTPUT -DCURVE_ALT_BN128 -DBOOST_SPIRIT_THREADSAFE -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Wstack-protector -fstack-protector-all -fPIE -Wl,-z,relro -Wl,-z,now -pie -pipe -O1 -g -Wstack-protector -fstack-protector-all -fPIE -fvisibility=hidden -DSTATIC -I. -I./obj -pthread -I/src/pirate.cli/pirate-5.0.0/depends/x86_64-unknown-linux-gnu/share/../include -I./leveldb/include -I./leveldb/helpers/memenv -I/src/pirate.cli/pirate-5.0.0/depends/x86_64-unknown-linux-gnu/include -I/src/pirate.cli/pirate-5.0.0/depends/x86_64-unknown-linux-gnu/include -I./secp256k1/include -I./cc/includes -I./cryptoconditions/include -I./cryptoconditions/src -I./cryptoconditions/src/asn -I./snark -I./snark/libsnark -I./univalue/include -DMONTGOMERY_OUTPUT -I/src/pirate.cli/pirate-5.0.0/depends/x86_64-unknown-linux-gnu/share/../include/libsnark -I/src/pirate.cli/pirate-5.0.0/depends/x86_64-unknown-linux-gnu/share/../include/ -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS -DMULTICORE -Wformat -Wformat-security -Wstack-protector -fstack-protector-all -fPIE -fwrapv -fno-strict-aliasing -pipe -O1 -g0 -O2 -fopenmp -fwrapv -fno-strict-aliasing -Wno-builtin-declaration-mismatch -fPIC -DHAVE_DECL_EVP_MD_CTX_NEW -MT zcash/address/libzcash_a-zip32.o -MD -MP -MF zcash/address/.deps/libzcash_a-zip32.Tpo -c -o zcash/address/libzcash_a-zip32.otest -f 'zcash/address/zip32.cpp' || echo './'zcash/address/zip32.cpp In file included from crypto/equihash.cpp:20: ./crypto/equihash.h: In function ‘bool EhBasicSolve(unsigned int, unsigned int, const eh_HashState&, std::function<bool(const std::vector<unsigned char>&)>, std::function<bool(EhSolverCancelCheck)>)’: ./crypto/equihash.h:256:20: error: ‘invalid_argument’ is not a member of ‘std’ 256 | throw std::invalid_argument("Unsupported Equihash parameters"); | ^~~~~~~~~~~~~~~~ ./crypto/equihash.h: In function ‘bool EhOptimisedSolve(unsigned int, unsigned int, const eh_HashState&, std::function<bool(const std::vector<unsigned char>&)>, std::function<bool(EhSolverCancelCheck)>)’: ./crypto/equihash.h:284:20: error: ‘invalid_argument’ is not a member of ‘std’ 284 | throw std::invalid_argument("Unsupported Equihash parameters"); | ^~~~~~~~~~~~~~~~ make[2]: *** [Makefile:4248: crypto/libbitcoin_crypto_a-equihash.o] Error 1 make[2]: *** Waiting for unfinished jobs.... mv -f zcash/.deps/libzcash_a-util.Tpo zcash/.deps/libzcash_a-util.Po mv -f cc/.deps/libbitcoin_common_a-CCutilbits.Tpo cc/.deps/libbitcoin_common_a-CCutilbits.Po mv -f cc/.deps/libbitcoin_common_a-CCtokenutils.Tpo cc/.deps/libbitcoin_common_a-CCtokenutils.Po mv -f .deps/libbitcoin_util_a-utilmoneystr.Tpo .deps/libbitcoin_util_a-utilmoneystr.Po mv -f crypto/.deps/libbitcoin_crypto_a-verus_hash.Tpo crypto/.deps/libbitcoin_crypto_a-verus_hash.Po mv -f .deps/libbitcoin_util_a-utiltime.Tpo .deps/libbitcoin_util_a-utiltime.Po mv -f .deps/libbitcoin_util_a-util.Tpo .deps/libbitcoin_util_a-util.Po cc1plus: warning: command-line option ‘-Wint-conversion’ is valid for C/ObjC but not for C++ mv -f crypto/.deps/libverus_crypto_a-verus_clhash.Tpo crypto/.deps/libverus_crypto_a-verus_clhash.Po cc1plus: warning: command-line option ‘-Wint-conversion’ is valid for C/ObjC but not for C++ mv -f crypto/.deps/libverus_portable_crypto_a-verus_clhash_portable.Tpo crypto/.deps/libverus_portable_crypto_a-verus_clhash_portable.Po mv -f zcash/address/.deps/libzcash_a-zip32.Tpo zcash/address/.deps/libzcash_a-zip32.Po mv -f .deps/libbitcoin_server_a-main.Tpo .deps/libbitcoin_server_a-main.Po make[2]: Leaving directory '/src/pirate.cli/pirate-5.0.0/src' make[1]: *** [Makefile:8684: all-recursive] Error 1 make[1]: Leaving directory '/src/pirate.cli/pirate-5.0.0/src' make: *** [Makefile:712: all-recursive] Error 1

So I came accross this https://forum.zcashcommunity.com/t/fail-to-build-on-fedora-32/36777/4 And added <stdexcept> to crypto/equihash.h and then it compiled flawlessly.

Is this an appropriate fix? I'm not really sure. Thanks.

CryptoForge commented 3 years ago

Missing header added with this pull request.

https://github.com/PirateNetwork/pirate/pull/28