0

更新到 MACOS Big Sur 并尝试编译 monero 分支 release-v0.16 后,我收到此错误:

    [ 36%] Built target ringct
Scanning dependencies of target obj_cryptonote_core
[ 37%] Building CXX object src/cryptonote_core/CMakeFiles/obj_cryptonote_core.dir/blockchain.cpp.o
In file included from /Users/myuser/Projects/myproject/monero-16/src/cryptonote_core/blockchain.cpp:39:
In file included from /Users/myuser/Projects/myproject/monero-16/src/cryptonote_core/blockchain.h:35:
/usr/local/include/boost/serialization/list.hpp:53:33: error: no type named 'library_version_type' in namespace 'boost::serialization'; did you mean 'item_version_type'?
    const boost::serialization::library_version_type library_version(
          ~~~~~~~~~~~~~~~~~~~~~~^
/usr/local/include/boost/serialization/item_version_type.hpp:25:7: note: 'item_version_type' declared here
class item_version_type {
      ^
In file included from /Users/myuser/Projects/myproject/monero-16/src/cryptonote_core/blockchain.cpp:39:
In file included from /Users/myuser/Projects/myproject/monero-16/src/cryptonote_core/blockchain.h:35:
/usr/local/include/boost/serialization/list.hpp:60:30: error: no member named 'library_version_type' in namespace 'boost::serialization'
    if(boost::serialization::library_version_type(3) < library_version){
       ~~~~~~~~~~~~~~~~~~~~~~^
/Users/myuser/Projects/myproject/monero-16/src/cryptonote_core/blockchain.cpp:1183:21: warning: loop variable 'bei' of type 'const cryptonote::Blockchain::block_extended_info'
      creates a copy from type 'const cryptonote::Blockchain::block_extended_info' [-Wrange-loop-analysis]
    for (const auto bei: boost::adaptors::reverse(alt_chain))
                    ^
/Users/myuser/Projects/myproject/monero-16/src/cryptonote_core/blockchain.cpp:1183:10: note: use reference type 'const cryptonote::Blockchain::block_extended_info &' to
      prevent copying
    for (const auto bei: boost::adaptors::reverse(alt_chain))
         ^~~~~~~~~~~~~~~
                    &
In file included from /Users/myuser/Projects/myproject/monero-16/src/cryptonote_core/blockchain.cpp:37:
In file included from /Users/myuser/Projects/myproject/monero-16/src/cryptonote_basic/cryptonote_basic_impl.h:33:
In file included from /Users/myuser/Projects/myproject/monero-16/src/cryptonote_basic/cryptonote_basic.h:41:
/Users/myuser/Projects/myproject/monero-16/src/serialization/binary_archive.h:195:28: warning: shift count >= width of type [-Wshift-count-overflow]
      if (1 < sizeof(T)) v >>= 8;
                           ^   ~
/Users/myuser/Projects/myproject/monero-16/src/serialization/binary_archive.h:188:5: note: in instantiation of function template specialization
      'binary_archive<true>::serialize_uint<unsigned char>' requested here
    serialize_uint(static_cast<typename boost::make_unsigned<T>::type>(v));
    ^
/Users/myuser/Projects/myproject/monero-16/src/serialization/binary_archive.h:228:5: note: in instantiation of function template specialization
      'binary_archive<true>::serialize_int<unsigned char>' requested here
    serialize_int(t);
    ^
2 warnings and 2 errors generated.
make[3]: *** [src/cryptonote_core/CMakeFiles/obj_cryptonote_core.dir/blockchain.cpp.o] Error 1
make[2]: *** [src/cryptonote_core/CMakeFiles/obj_cryptonote_core.dir/all] Error 2
make[1]: *** [all] Error 2
make: *** [release-all] Error 2
4

1 回答 1

0

看起来缺少一个包含 - 我无法在 Linux 上重现,使用 18.04 发行版包(1.65.1,从头开始编译干净¹)。

github中有一个相关的修复:https ://github.com/boostorg/serialization/commit/f72b9fc8d953a5dd39615535b5c6bab5b8be42fe

commit f72b9fc8d953a5dd39615535b5c6bab5b8be42fe
Author: Robert Ramey <ramey@rrsd.com>
Date:   Sat Sep 26 22:55:18 2020 -0700

    included library_version.hpp in all appropriate places.
    This should permit any header to be compiled without including any other headers.

这已合并到 master,但那是在 1.74.0 之后,所以它还不存在。

显然,在必要时包含标题应该很容易:

 #include <boost/serialization/library_version_type.hpp>

¹ 好吧,有 4 个不相关的警告

于 2020-12-07T17:11:28.677 回答