Crypto-Currency / Emerald-OLD---DO-NOT-USE

Emerald Crypto scrypt-based cryptocurrency
http://emeraldcrypto.de/
MIT License
7 stars 8 forks source link

gcc 11 compatibility #5

Open lvypaul opened 2 years ago

lvypaul commented 2 years ago

Hi, Compiling the code in FC35 created a lot of fun but one of the things I could not figure out and maybe someone can help me with this:

In file included from /usr/include/c++/11/set:60, from src/alert.h:9, from src/main.cpp:6: /usr/include/c++/11/bits/stl_tree.h: In instantiation of ‘static const _Key& std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_S_key(std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Const_Link_type) [with _Key = CBlockIndex; _Val = CBlockIndex; _KeyOfValue = std::_Identity<CBlockIndex>; _Compare = CBlockIndexWorkComparator; _Alloc = std::allocator<CBlockIndex>; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Const_Link_type = const std::_Rb_tree_node<CBlockIndex>]’: /usr/include/c++/11/bits/stl_tree.h:1971:37: required from ‘std::pair<std::_Rb_tree_iterator<_Val>, std::_Rb_tree_iterator<_Val> > std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::equal_range(const _Key&) [with _Key = CBlockIndex; _Val = CBlockIndex; _KeyOfValue = std::_Identity<CBlockIndex>; _Compare = CBlockIndexWorkComparator; _Alloc = std::allocator<CBlockIndex>]’ /usr/include/c++/11/bits/stl_tree.h:2508:49: required from ‘std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::size_type std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::erase(const _Key&) [with _Key = CBlockIndex; _Val = CBlockIndex; _KeyOfValue = std::_Identity<CBlockIndex>; _Compare = CBlockIndexWorkComparator; _Alloc = std::allocator<CBlockIndex>; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::size_type = long unsigned int]’ /usr/include/c++/11/bits/stl_set.h:685:26: required from ‘std::set<_Key, _Compare, _Alloc>::size_type std::set<_Key, _Compare, _Alloc>::erase(const key_type&) [with _Key = CBlockIndex; _Compare = CBlockIndexWorkComparator; _Alloc = std::allocator<CBlockIndex>; std::set<_Key, _Compare, _Alloc>::size_type = long unsigned int; std::set<_Key, _Compare, _Alloc>::key_type = CBlockIndex]’ src/main.cpp:1384:29: required from here /usr/include/c++/11/bits/stl_tree.h:770:15: error: static assertion failed: comparison object must be invocable as const 770 | is_invocable_v<const _Compare&, const _Key&, const _Key&>, | ^~~~~~~~~~~~~ /usr/include/c++/11/bits/stl_tree.h:770:15: note: ‘std::is_invocable_v<const CBlockIndexWorkComparator&, CBlockIndex const&, CBlockIndex* const&>’ evaluates to false make: *** [Makefile:2061: build/main.o] Error 1

So, it seems that something in the definition of setBlockIndexValid must be added. The code compiles using previous version of GCC so in order to use the wallet I compiled it by adding -std=gnu++14 flag to compiler but I would like to have it compiled also with -std=gnu++17

If anyone has an ideea what I should do to compile it please leave comment

Thank you, Paul