monero-lws icon indicating copy to clipboard operation
monero-lws copied to clipboard

Build error on release-v0.3_0.18 branch due to C++ 17

Open woodser opened this issue 1 year ago • 1 comments

I'm getting this error building on the release-v0.3_0.18 branch:

In file included from /Users/woodser/git/monero-lws/src/db/string.cpp:30:
/Users/woodser/git/monero-java/external/monero-cpp/external/monero-project/src/cryptonote_basic/cryptonote_basic_impl.h:43:29: error: no template named 'unary_function' in namespace 'std'; did you mean '__unary_function'?
  struct array_hasher: std::unary_function<t_array&, std::size_t>
                       ~~~~~^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/usr/include/c++/v1/__functional/unary_function.h:46:1: note: '__unary_function' declared here
using __unary_function = __unary_function_keep_layout_base<_Arg, _Result>;
^

The error resolves by changing set(CMAKE_CXX_STANDARD 17) to set(CMAKE_CXX_STANDARD 14).

Guessing it's too far ahead of monero-project?

woodser avatar Apr 11 '24 11:04 woodser

Upstream master branch is on CXX17 whereas the release branch is on CXX14. Luckily I only use CXX17 in one spot in the tests which can be trivially removed.

vtnerd avatar Apr 11 '24 16:04 vtnerd