ValveSoftware / GameNetworkingSockets

Reliable & unreliable messages over UDP. Robust message fragmentation & reassembly. P2P networking / NAT traversal. Encryption.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Building fails on Archlinux with error

Brensom opened this issue · comments

Building fails to me on the current master version:

/usr/include/absl/log/internal/log_message.h:334:3: note: candidate: ‘absl::lts_20230125::log_internal::LogMessageFatal::LogMessageFatal(const char*, int)’
  334 |   LogMessageFatal(const char* file, int line) ABSL_ATTRIBUTE_COLD;
      |   ^~~~~~~~~~~~~~~
/usr/include/absl/log/internal/log_message.h:334:3: note:   candidate expects 2 arguments, 3 provided
/usr/include/absl/strings/cord.h: In instantiation of ‘H absl::lts_20230125::Cord::HashFragmented(H) const [with H = absl::lts_20230125::hash_internal::MixingHashState]’:
/usr/include/absl/strings/cord.h:762:28:   required from ‘H absl::lts_20230125::AbslHashValue(H, const Cord&) [with H = hash_internal::MixingHashState]’
/usr/include/absl/hash/internal/hash.h:871:27:   required from ‘static absl::lts_20230125::enable_if_t<std::is_same<H, decltype (absl::lts_20230125::hash_internal::AbslHashValue(std::move(state), value))>::value, H> absl::lts_20230125::hash_internal::HashSelect::HashValueProbe::Invoke(H, const T&) [with H = absl::lts_20230125::hash_internal::MixingHashState; T = absl::lts_20230125::Cord; absl::lts_20230125::enable_if_t<std::is_same<H, decltype (absl::lts_20230125::hash_internal::AbslHashValue(std::move(state), value))>::value, H> = absl::lts_20230125::hash_internal::MixingHashState; decltype (absl::lts_20230125::hash_internal::AbslHashValue(std::move(state), value)) = absl::lts_20230125::hash_internal::MixingHashState]’
/usr/include/absl/hash/internal/hash.h:1241:73:   required from ‘static H absl::lts_20230125::hash_internal::HashStateBase<H>::combine(H, const T&, const Ts& ...) [with T = absl::lts_20230125::Cord; Ts = {}; H = absl::lts_20230125::hash_internal::MixingHashState]’
/usr/include/absl/hash/internal/hash.h:978:39:   required from ‘static size_t absl::lts_20230125::hash_internal::MixingHashState::hash(const T&) [with T = absl::lts_20230125::Cord; typename std::enable_if<(! absl::lts_20230125::conjunction<std::is_integral<_Tp>, absl::lts_20230125::hash_internal::is_uniquely_represented<T, void> >::value), int>::type <anonymous> = 0; size_t = long unsigned int]’
/usr/include/absl/hash/internal/hash.h:1230:33:   required from ‘size_t absl::lts_20230125::hash_internal::HashImpl<T>::operator()(const T&) const [with T = absl::lts_20230125::Cord; size_t = long unsigned int]’
/usr/include/absl/container/internal/hash_function_defaults.h:77:36:   required from here
/usr/include/absl/strings/cord.h:999:18: error: cannot convert ‘absl::lts_20230125::Cord::HashFragmented<absl::lts_20230125::hash_internal::MixingHashState>(absl::lts_20230125::hash_internal::MixingHashState) const::<lambda(int)>’ to ‘int’
  999 |     ForEachChunk([&combiner, &hash_state](absl::string_view chunk) {
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                  |
      |                  absl::lts_20230125::Cord::HashFragmented<absl::lts_20230125::hash_internal::MixingHashState>(absl::lts_20230125::hash_internal::MixingHashState) const::<lambda(int)>
 1000 |       hash_state = combiner.add_buffer(std::move(hash_state), chunk.data(),
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1001 |                                        chunk.size());
      |                                        ~~~~~~~~~~~~~~
 1002 |     });
      |     ~             
/usr/include/absl/strings/cord.h:1564:48: note:   initializing argument 1 of ‘void absl::lts_20230125::Cord::ForEachChunk(int) const’
 1564 |     absl::FunctionRef<void(absl::string_view)> callback) const {
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
At global scope:
cc1plus: note: unrecognized command-line option ‘-Wno-nested-anon-types’ may have been intended to silence earlier diagnostics
cc1plus: note: unrecognized command-line option ‘-Wno-unused-local-typedef’ may have been intended to silence earlier diagnostics
ninja: build stopped: subcommand failed.
==> ERROR: A failure occurred in build().

My build system:

COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/13.1.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /build/gcc/src/gcc/configure --enable-languages=ada,c,c++,d,fortran,go,lto,objc,obj-c++ --enable-bootstrap --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --with-build-config=bootstrap-lto --with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit --enable-cet=auto --enable-checking=release --enable-clocale=gnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object --enable-libstdcxx-backtrace --enable-link-serialization=1 --enable-linker-build-id --enable-lto --enable-multilib --enable-plugin --enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch --disable-werror
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 13.1.1 20230429 (GCC) 

I don't know how you are getting abseil, but you appear to be compiling with a newer version than the pinned submodule in this code, at the time you submitted this bug. And I don't see any identifiers in any of that output that has anything to do with this library. So that error appears to be entirely related to the version of abseil you are using. Am I missing something?

I'm having the same issue - GCC seems to be using the system-installed version of abseil and protobuf, and I initialized the submodules with git submodule update --jobs 12 --init --progress --depth 1.

commented

Hi, i had the same issue. Abseil and Protobuf require at least the C++ 14 standard (in my case i had to use C++ 17) but the library is compiled with the C++11 standard. After uncommenting the line 268 in the file src/CMakeLists.txt and changing it to the following solved it for me.
target_compile_features(${GNS_TARGET} PUBLIC c_std_99 cxx_std_17)
I am now able to compile and use the library without any problems.