Skip to content

Compile on ArchLinux, protobuf error?

Hi,

I'm trying to compile vlc-android on archlinux. I'm specifically trying the x86_64 architecture but only because it in my novice opinion should be easiest. I don't mind putting it on another architecture.

I've followed the steps as written here: https://wiki.videolan.org/AndroidCompile/ Essentially it means that i installed the packages listed there but just the Arch names.

Now when compiling things go wrong quick. The documentation states that i need java 8. Gradle does run for a bit but then complains that it needs java 11. Which on is it?... I just installed java 11 in an attempt to get further. Which worked, somewhat.

Next i get this compile error:

/usr/include/c++/11.1.0/bits/stl_set.h:512:25:   required from 'std::pair<typename std::_Rb_tree<_Key, _Key, std::_Identity<_Tp>, _Compare, typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<_Key>::other>::const_iterator, bool> std::set<_Key, _Compare, _Alloc>::insert(const value_type&) [with _Key = const google::protobuf::FieldDescriptor*; _Compare = google::protobuf::compiler::java::{anonymous}::FieldDescriptorCompare; _Alloc = std::allocator<const google::protobuf::FieldDescriptor*>; typename std::_Rb_tree<_Key, _Key, std::_Identity<_Tp>, _Compare, typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<_Key>::other>::const_iterator = std::_Rb_tree<const google::protobuf::FieldDescriptor*, const google::protobuf::FieldDescriptor*, std::_Identity<const google::protobuf::FieldDescriptor*>, google::protobuf::compiler::java::{anonymous}::FieldDescriptorCompare, std::allocator<const google::protobuf::FieldDescriptor*> >::const_iterator; typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<_Key>::other = std::allocator<const google::protobuf::FieldDescriptor*>; typename __gnu_cxx::__alloc_traits<_Allocator>::rebind<_Key> = __gnu_cxx::__alloc_traits<std::allocator<const google::protobuf::FieldDescriptor*>, const google::protobuf::FieldDescriptor*>::rebind<const google::protobuf::FieldDescriptor*>; typename _Allocator::value_type = const google::protobuf::FieldDescriptor*; std::set<_Key, _Compare, _Alloc>::value_type = const google::protobuf::FieldDescriptor*]'
google/protobuf/compiler/java/java_file.cc:97:54:   required from here
/usr/include/c++/11.1.0/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&>,
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Based on the code context (and file), this is some protobuf error?

The gcc version i use:

❯ g++ --version
g++ (GCC) 11.1.0
Copyright (C) 2021 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.

Do i need to do something specific to get past this error?

Best regards, Mark Gaiser

Edited by markg85