Open MarkusNemesis opened 1 year ago
Hmm, I use Debian 10 and gcc/g++ v8.3.0 to compile (and cross-compile to ARM) release builds without any problems. Is there an issue with nlohmann json that's very specific to gcc/g++ v10.x?
> lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 10 (buster)
Release: 10
Codename: buster
> g++ --version
g++ (Debian 8.3.0-6) 8.3.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> arm-linux-gnueabihf-g++ --version
arm-linux-gnueabihf-g++ (Debian 8.3.0-2) 8.3.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Can you provide me the exact steps you took to build? It could be an issue specific to Raspberry Pi OS Lite (Bullseye).
I identified C++11 as the potential issue, as that's what nlohmann json states in their readme "The class is written in vanilla C++11", and the fact that it was what g++ was stopping on.
GCC 8.3.0 definitely supports C++11 -- in fact, musikcube requires C++17: https://github.com/clangen/musikcube/blob/master/.cmake/ConfigureCompilerFlags.cmake#L2
Did you follow the build instructions here? https://github.com/clangen/musikcube/wiki/building
They discuss Ubuntu, but Debian is very similar (there may just be slightly different package names).
Also, if you provide a specific error message I may be able to help.
I'm seeing the same problem on a Raspberry Pi 4B running Debian Bullseye.
Also, if you provide a specific error message I may be able to help.
[ 16%] Linking CXX shared library ../../../bin/plugins/libhttpdatastream.so
[ 16%] Building CXX object src/plugins/server/CMakeFiles/server.dir/Util.cpp.o
[ 16%] Built target httpdatastream
[ 17%] Building CXX object src/plugins/server/CMakeFiles/server.dir/WebSocketServer.cpp.o
In file included from /usr/include/c++/10/vector:66,
from /usr/include/c++/10/functional:62,
from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13,
from /usr/include/c++/10/algorithm:74,
from /home/benjamin/musikcube/src/plugins/server/Util.h:38,
from /home/benjamin/musikcube/src/plugins/server/Constants.h:39,
from /home/benjamin/musikcube/src/plugins/server/main.cpp:35:
/usr/include/c++/10/bits/stl_uninitialized.h: In instantiation of ‘_ForwardIterator std::uninitialized_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = __gnu_cxx::__normal_iterator<const nlohmann::basic_json<>*, std::vector<nlohmann::basic_json<>, std::allocator<nlohmann::basic_json<> > > >; _ForwardIterator = nlohmann::basic_json<>*]’:
/usr/include/c++/10/bits/stl_uninitialized.h:325:37: required from ‘_ForwardIterator std::__uninitialized_copy_a(_InputIterator, _InputIterator, _ForwardIterator, std::allocator<_Tp>&) [with _InputIterator = __gnu_cxx::__normal_iterator<const nlohmann::basic_json<>*, std::vector<nlohmann::basic_json<>, std::allocator<nlohmann::basic_json<> > > >; _ForwardIterator = nlohmann::basic_json<>*; _Tp = nlohmann::basic_json<>]’
/usr/include/c++/10/bits/stl_vector.h:558:31: required from ‘std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&) [with _Tp = nlohmann::basic_json<>; _Alloc = std::allocator<nlohmann::basic_json<> >]’
/usr/include/c++/10/ext/new_allocator.h:150:4: required from ‘void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = std::vector<nlohmann::basic_json<>, std::allocator<nlohmann::basic_json<> > >; _Args = {const std::vector<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long int, long unsigned int, double, std::allocator, nlohmann::adl_serializer>, std::allocator<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long int, long unsigned int, double, std::allocator, nlohmann::adl_serializer> > >&}; _Tp = std::vector<nlohmann::basic_json<>, std::allocator<nlohmann::basic_json<> > >]’
/usr/include/c++/10/bits/alloc_traits.h:512:17: required from ‘static void std::allocator_traits<std::allocator<_CharT> >::construct(std::allocator_traits<std::allocator<_CharT> >::allocator_type&, _Up*, _Args&& ...) [with _Up = std::vector<nlohmann::basic_json<>, std::allocator<nlohmann::basic_json<> > >; _Args = {const std::vector<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long int, long unsigned int, double, std::allocator, nlohmann::adl_serializer>, std::allocator<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long int, long unsigned int, double, std::allocator, nlohmann::adl_serializer> > >&}; _Tp = std::vector<nlohmann::basic_json<>, std::allocator<nlohmann::basic_json<> > >; std::allocator_traits<std::allocator<_CharT> >::allocator_type = std::allocator<std::vector<nlohmann::basic_json<>, std::allocator<nlohmann::basic_json<> > > >]’
/home/benjamin/musikcube/src/3rdparty/include/nlohmann/json.hpp:15381:35: required from ‘static T* nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer>::create(Args&& ...) [with T = std::vector<nlohmann::basic_json<>, std::allocator<nlohmann::basic_json<> > >; Args = {const std::vector<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long int, long unsigned int, double, std::allocator, nlohmann::adl_serializer>, std::allocator<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long int, long unsigned int, double, std::allocator, nlohmann::adl_serializer> > >&}; ObjectType = std::map; ArrayType = std::vector; StringType = std::__cxx11::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator; JSONSerializer = nlohmann::adl_serializer]’
/home/benjamin/musikcube/src/3rdparty/include/nlohmann/json.hpp:15533:36: required from ‘nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer>::json_value::json_value(const array_t&) [with ObjectType = std::map; ArrayType = std::vector; StringType = std::__cxx11::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator; JSONSerializer = nlohmann::adl_serializer; nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer>::array_t = std::vector<nlohmann::basic_json<>, std::allocator<nlohmann::basic_json<> > >]’
/home/benjamin/musikcube/src/3rdparty/include/nlohmann/json.hpp:16318:25: required from ‘nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer>::basic_json(const nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer>&) [with ObjectType = std::map; ArrayType = std::vector; StringType = std::__cxx11::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator; JSONSerializer = nlohmann::adl_serializer]’
/home/benjamin/musikcube/src/3rdparty/include/nlohmann/json.hpp:11138:17: required from ‘nlohmann::detail::json_ref<BasicJsonType>::value_type nlohmann::detail::json_ref<BasicJsonType>::moved_or_copied() const [with BasicJsonType = nlohmann::basic_json<>; nlohmann::detail::json_ref<BasicJsonType>::value_type = nlohmann::basic_json<>]’
/home/benjamin/musikcube/src/3rdparty/include/nlohmann/json.hpp:15988:59: required from ‘nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer>::basic_json(nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer>::initializer_list_t, bool, nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer>::value_t) [with ObjectType = std::map; ArrayType = std::vector; StringType = std::__cxx11::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator; JSONSerializer = nlohmann::adl_serializer; nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer>::initializer_list_t = std::initializer_list<nlohmann::detail::json_ref<nlohmann::basic_json<> > >; nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer>::value_t = nlohmann::detail::value_t]’
/home/benjamin/musikcube/src/plugins/server/WebSocketServer.h:135:99: required from here
/usr/include/c++/10/bits/stl_uninitialized.h:137:72: error: ‘value’ is not a member of ‘std::is_constructible<nlohmann::basic_json<>, const nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long int, long unsigned int, double, std::allocator, nlohmann::adl_serializer>&>’
137 | static_assert(is_constructible<_ValueType2, decltype(*__first)>::value,
| ^~~~~
make[2]: *** [src/plugins/server/CMakeFiles/server.dir/build.make:108: src/plugins/server/CMakeFiles/server.dir/main.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from /usr/include/c++/10/bits/move.h:57,
from /usr/include/c++/10/bits/stl_pair.h:59,
from /usr/include/c++/10/bits/stl_algobase.h:64,
from /usr/include/c++/10/bits/char_traits.h:39,
from /usr/include/c++/10/string:40,
from /home/benjamin/musikcube/src/musikcore/sdk/version.h:37,
from /home/benjamin/musikcube/src/musikcore/sdk/constants.h:37,
from /home/benjamin/musikcube/src/musikcore/sdk/IResource.h:38,
from /home/benjamin/musikcube/src/musikcore/sdk/IValue.h:37,
from /home/benjamin/musikcube/src/musikcore/sdk/IMap.h:37,
from /home/benjamin/musikcube/src/musikcore/sdk/ITrack.h:37,
from /home/benjamin/musikcube/src/musikcore/sdk/ITrackList.h:38,
from /home/benjamin/musikcube/src/musikcore/sdk/IMetadataProxy.h:37,
from /home/benjamin/musikcube/src/plugins/server/Context.h:37,
from /home/benjamin/musikcube/src/plugins/server/WebSocketServer.h:35,
from /home/benjamin/musikcube/src/plugins/server/WebSocketServer.cpp:35:
/usr/include/c++/10/type_traits: In instantiation of ‘struct std::is_constructible<nlohmann::basic_json<>, const nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long int, long unsigned int, double, std::allocator, nlohmann::adl_serializer>&>’:
/home/benjamin/musikcube/src/3rdparty/include/nlohmann/json.hpp:11120:79: required by substitution of ‘template<class ... Args, typename std::enable_if<std::is_constructible<nlohmann::basic_json<>, Args ...>::value, int>::type <anonymous> > nlohmann::detail::json_ref<nlohmann::basic_json<> >::json_ref(Args&& ...) [with Args = {const nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long int, long unsigned int, double, std::allocator, nlohmann::adl_serializer>&}; typename std::enable_if<std::is_constructible<nlohmann::basic_json<>, Args ...>::value, int>::type <anonymous> = <missing>]’
/usr/include/c++/10/type_traits:901:30: required from ‘struct std::__is_constructible_impl<nlohmann::basic_json<>, const nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long int, long unsigned int, double, std::allocator, nlohmann::adl_serializer>&>’
/usr/include/c++/10/type_traits:930:12: required from ‘struct std::__is_copy_constructible_impl<nlohmann::basic_json<>, true>’
/usr/include/c++/10/type_traits:936:12: required from ‘struct std::is_copy_constructible<nlohmann::basic_json<> >’
/usr/include/c++/10/any:185:49: required by substitution of ‘template<class _Tp, class _VTp, class _Mgr, typename std::enable_if<(std::is_copy_constructible<_Tp>::value && (! std::__is_in_place_type<_VTp>::value)), bool>::type <anonymous> > std::any::any(_Tp&&) [with _Tp = nlohmann::basic_json<>&; _VTp = nlohmann::basic_json<>; _Mgr = std::any::_Manager_external<nlohmann::basic_json<> >; typename std::enable_if<(std::is_copy_constructible<_Tp>::value && (! std::__is_in_place_type<_VTp>::value)), bool>::type <anonymous> = <missing>]’
/usr/include/c++/10/type_traits:2670:31: required by substitution of ‘template<class _Tp, class> static std::true_type std::__swappable_details::__do_is_swappable_impl::__test(int) [with _Tp = nlohmann::basic_json<>; <template-parameter-1-2> = <missing>]’
/usr/include/c++/10/type_traits:2694:35: required from ‘struct std::__is_swappable_impl<nlohmann::basic_json<> >’
/usr/include/c++/10/type_traits:2720:12: required from ‘struct std::is_swappable<nlohmann::basic_json<> >’
/usr/include/c++/10/type_traits:2740:26: required from ‘constexpr const bool std::is_swappable_v<nlohmann::basic_json<> >’
/usr/include/c++/10/optional:1231:51: required by substitution of ‘template<class _Tp> std::enable_if_t<(!(is_move_constructible_v<_Tp> && is_swappable_v<_Tp>))> std::swap(std::optional<_Tp>&, std::optional<_Tp>&) [with _Tp = nlohmann::basic_json<>]’
/home/benjamin/musikcube/src/3rdparty/include/nlohmann/json.hpp:22630:1: required from here
/usr/include/c++/10/type_traits:906:12: error: invalid use of incomplete type ‘struct std::__is_constructible_impl<nlohmann::basic_json<>, const nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long int, long unsigned int, double, std::allocator, nlohmann::adl_serializer>&>’
906 | struct is_constructible
| ^~~~~~~~~~~~~~~~
/usr/include/c++/10/type_traits:900:12: note: declaration of ‘struct std::__is_constructible_impl<nlohmann::basic_json<>, const nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long int, long unsigned int, double, std::allocator, nlohmann::adl_serializer>&>’
900 | struct __is_constructible_impl
| ^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/10/bits/stl_algobase.h:64,
from /usr/include/c++/10/bits/char_traits.h:39,
from /usr/include/c++/10/string:40,
from /home/benjamin/musikcube/src/musikcore/sdk/version.h:37,
from /home/benjamin/musikcube/src/musikcore/sdk/constants.h:37,
from /home/benjamin/musikcube/src/musikcore/sdk/IResource.h:38,
from /home/benjamin/musikcube/src/musikcore/sdk/IValue.h:37,
from /home/benjamin/musikcube/src/musikcore/sdk/IMap.h:37,
from /home/benjamin/musikcube/src/musikcore/sdk/ITrack.h:37,
from /home/benjamin/musikcube/src/musikcore/sdk/ITrackList.h:38,
from /home/benjamin/musikcube/src/musikcore/sdk/IMetadataProxy.h:37,
from /home/benjamin/musikcube/src/plugins/server/Context.h:37,
from /home/benjamin/musikcube/src/plugins/server/WebSocketServer.h:35,
from /home/benjamin/musikcube/src/plugins/server/WebSocketServer.cpp:35:
/usr/include/c++/10/bits/stl_pair.h: In instantiation of ‘static constexpr bool std::_PCC<<anonymous>, _T1, _T2>::_ConstructiblePair() [with _U1 = const std::__cxx11::basic_string<char>; _U2 = nlohmann::basic_json<>; bool <anonymous> = true; _T1 = const std::__cxx11::basic_string<char>; _T2 = nlohmann::basic_json<>]’:
/usr/include/c++/10/bits/stl_pair.h:262:35: required by substitution of ‘template<class _U1, class _U2, typename std::enable_if<(_ConstructiblePair<_U1, _U2>() && _ImplicitlyConvertiblePair<_U1, _U2>()), bool>::type <anonymous> > constexpr std::pair<const std::__cxx11::basic_string<char>, nlohmann::basic_json<> >::pair(const std::__cxx11::basic_string<char>&, const nlohmann::basic_json<>&) [with _U1 = const std::__cxx11::basic_string<char>; _U2 = nlohmann::basic_json<>; typename std::enable_if<(_ConstructiblePair<_U1, _U2>() && _ImplicitlyConvertiblePair<_U1, _U2>()), bool>::type <anonymous> = <missing>]’
/home/benjamin/musikcube/src/plugins/server/WebSocketServer.cpp:1367:10: required from here
/usr/include/c++/10/bits/stl_pair.h:107:45: error: ‘value’ is not a member of ‘std::__and_<std::is_constructible<const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&>, std::is_constructible<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long int, long unsigned int, double, std::allocator, nlohmann::adl_serializer>, const nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long int, long unsigned int, double, std::allocator, nlohmann::adl_serializer>&> >’
107 | is_constructible<_T2, const _U2&>>::value;
| ^~~~~
In file included from /usr/include/c++/10/memory:66,
from /usr/include/c++/10/thread:44,
from /home/benjamin/musikcube/src/3rdparty/include/websocketpp/common/thread.hpp:59,
from /home/benjamin/musikcube/src/3rdparty/include/websocketpp/concurrency/basic.hpp:31,
from /home/benjamin/musikcube/src/3rdparty/include/websocketpp/config/core.hpp:37,
from /home/benjamin/musikcube/src/3rdparty/include/websocketpp/config/asio_no_tls.hpp:31,
from /home/benjamin/musikcube/src/plugins/server/WebSocketServer.h:42,
from /home/benjamin/musikcube/src/plugins/server/WebSocketServer.cpp:35:
/usr/include/c++/10/bits/stl_uninitialized.h: In instantiation of ‘_ForwardIterator std::uninitialized_fill_n(_ForwardIterator, _Size, const _Tp&) [with _ForwardIterator = nlohmann::basic_json<>*; _Size = long unsigned int; _Tp = nlohmann::basic_json<>]’:
/usr/include/c++/10/bits/stl_uninitialized.h:402:39: required from ‘_ForwardIterator std::__uninitialized_fill_n_a(_ForwardIterator, _Size, const _Tp&, std::allocator<_Tp2>&) [with _ForwardIterator = nlohmann::basic_json<>*; _Size = long unsigned int; _Tp = nlohmann::basic_json<>; _Tp2 = nlohmann::basic_json<>]’
/usr/include/c++/10/bits/vector.tcc:543:36: required from ‘void std::vector<_Tp, _Alloc>::_M_fill_insert(std::vector<_Tp, _Alloc>::iterator, std::vector<_Tp, _Alloc>::size_type, const value_type&) [with _Tp = nlohmann::basic_json<>; _Alloc = std::allocator<nlohmann::basic_json<> >; std::vector<_Tp, _Alloc>::iterator = std::vector<nlohmann::basic_json<>, std::allocator<nlohmann::basic_json<> > >::iterator; std::vector<_Tp, _Alloc>::size_type = long unsigned int; std::vector<_Tp, _Alloc>::value_type = nlohmann::basic_json<>]’
/usr/include/c++/10/bits/stl_vector.h:1338:2: required from ‘std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::insert(std::vector<_Tp, _Alloc>::const_iterator, std::vector<_Tp, _Alloc>::size_type, const value_type&) [with _Tp = nlohmann::basic_json<>; _Alloc = std::allocator<nlohmann::basic_json<> >; std::vector<_Tp, _Alloc>::iterator = std::vector<nlohmann::basic_json<>, std::allocator<nlohmann::basic_json<> > >::iterator; std::vector<_Tp, _Alloc>::const_iterator = std::vector<nlohmann::basic_json<>, std::allocator<nlohmann::basic_json<> > >::const_iterator; std::vector<_Tp, _Alloc>::size_type = long unsigned int; std::vector<_Tp, _Alloc>::value_type = nlohmann::basic_json<>]’
/home/benjamin/musikcube/src/3rdparty/include/nlohmann/json.hpp:17683:38: required from ‘nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer>::value_type& nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer>::operator[](nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer>::size_type) [with ObjectType = std::map; ArrayType = std::vector; StringType = std::__cxx11::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator; JSONSerializer = nlohmann::adl_serializer; nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer>::reference = nlohmann::basic_json<>&; nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer>::value_type = nlohmann::basic_json<>; nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer>::size_type = long unsigned int]’
/home/benjamin/musikcube/src/plugins/server/WebSocketServer.cpp:103:18: required from here
/usr/include/c++/10/bits/stl_uninitialized.h:281:63: error: ‘value’ is not a member of ‘std::is_constructible<nlohmann::basic_json<>, const nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long int, long unsigned int, double, std::allocator, nlohmann::adl_serializer>&>’
281 | static_assert(is_constructible<_ValueType, const _Tp&>::value,
| ^~~~~
/usr/include/c++/10/bits/stl_uninitialized.h: In instantiation of ‘_ForwardIterator std::uninitialized_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = __gnu_cxx::__normal_iterator<const nlohmann::basic_json<>*, std::vector<nlohmann::basic_json<>, std::allocator<nlohmann::basic_json<> > > >; _ForwardIterator = nlohmann::basic_json<>*]’:
/usr/include/c++/10/bits/stl_uninitialized.h:325:37: required from ‘_ForwardIterator std::__uninitialized_copy_a(_InputIterator, _InputIterator, _ForwardIterator, std::allocator<_Tp>&) [with _InputIterator = __gnu_cxx::__normal_iterator<const nlohmann::basic_json<>*, std::vector<nlohmann::basic_json<>, std::allocator<nlohmann::basic_json<> > > >; _ForwardIterator = nlohmann::basic_json<>*; _Tp = nlohmann::basic_json<>]’
/usr/include/c++/10/bits/stl_vector.h:558:31: required from ‘std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&) [with _Tp = nlohmann::basic_json<>; _Alloc = std::allocator<nlohmann::basic_json<> >]’
/usr/include/c++/10/ext/new_allocator.h:150:4: required from ‘void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = std::vector<nlohmann::basic_json<>, std::allocator<nlohmann::basic_json<> > >; _Args = {const std::vector<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long int, long unsigned int, double, std::allocator, nlohmann::adl_serializer>, std::allocator<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long int, long unsigned int, double, std::allocator, nlohmann::adl_serializer> > >&}; _Tp = std::vector<nlohmann::basic_json<>, std::allocator<nlohmann::basic_json<> > >]’
/usr/include/c++/10/bits/alloc_traits.h:512:17: required from ‘static void std::allocator_traits<std::allocator<_CharT> >::construct(std::allocator_traits<std::allocator<_CharT> >::allocator_type&, _Up*, _Args&& ...) [with _Up = std::vector<nlohmann::basic_json<>, std::allocator<nlohmann::basic_json<> > >; _Args = {const std::vector<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long int, long unsigned int, double, std::allocator, nlohmann::adl_serializer>, std::allocator<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long int, long unsigned int, double, std::allocator, nlohmann::adl_serializer> > >&}; _Tp = std::vector<nlohmann::basic_json<>, std::allocator<nlohmann::basic_json<> > >; std::allocator_traits<std::allocator<_CharT> >::allocator_type = std::allocator<std::vector<nlohmann::basic_json<>, std::allocator<nlohmann::basic_json<> > > >]’
/home/benjamin/musikcube/src/3rdparty/include/nlohmann/json.hpp:15381:35: required from ‘static T* nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer>::create(Args&& ...) [with T = std::vector<nlohmann::basic_json<>, std::allocator<nlohmann::basic_json<> > >; Args = {const std::vector<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long int, long unsigned int, double, std::allocator, nlohmann::adl_serializer>, std::allocator<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long int, long unsigned int, double, std::allocator, nlohmann::adl_serializer> > >&}; ObjectType = std::map; ArrayType = std::vector; StringType = std::__cxx11::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator; JSONSerializer = nlohmann::adl_serializer]’
/home/benjamin/musikcube/src/3rdparty/include/nlohmann/json.hpp:15533:36: required from ‘nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer>::json_value::json_value(const array_t&) [with ObjectType = std::map; ArrayType = std::vector; StringType = std::__cxx11::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator; JSONSerializer = nlohmann::adl_serializer; nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer>::array_t = std::vector<nlohmann::basic_json<>, std::allocator<nlohmann::basic_json<> > >]’
/home/benjamin/musikcube/src/3rdparty/include/nlohmann/json.hpp:16318:25: required from ‘nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer>::basic_json(const nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer>&) [with ObjectType = std::map; ArrayType = std::vector; StringType = std::__cxx11::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator; JSONSerializer = nlohmann::adl_serializer]’
/home/benjamin/musikcube/src/plugins/server/WebSocketServer.cpp:514:29: required from here
/usr/include/c++/10/bits/stl_uninitialized.h:137:72: error: ‘value’ is not a member of ‘std::is_constructible<nlohmann::basic_json<>, const nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long int, long unsigned int, double, std::allocator, nlohmann::adl_serializer>&>’
137 | static_assert(is_constructible<_ValueType2, decltype(*__first)>::value,
| ^~~~~
make[2]: *** [src/plugins/server/CMakeFiles/server.dir/build.make:173: src/plugins/server/CMakeFiles/server.dir/WebSocketServer.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:809: src/plugins/server/CMakeFiles/server.dir/all] Error 2
make: *** [Makefile:149: all] Error 2
> lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 11 (bullseye)
Release: 11
Codename: bullseye
> g++ --version
g++ (Debian 10.2.1-6) 10.2.1 20210110
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
I'm unsure of if this is the same problem that @MarkusNemesis encountered, but it seems like it is.
FYI, you cannot build this on Debian by default, as current Debian doesn't have gcc/g++ 11 support, which is required to compile nlohmann's json.
May want to put a notice on the build instructions that Debian is not supported, unless you add the bookworm/sid repos and then install the deps, etc. ensuring gcc --version outputs version 11.
I'm simply trying to build this for a Raspberry Pi 3B on Raspberry Pi OS Lite (Bullseye), and it's reminding me why I loath Debian...
Cheers