Warum kann der Linker keine ABSL-Referenzen finden?C++

Programme in C++. Entwicklerforum
Anonymous
 Warum kann der Linker keine ABSL-Referenzen finden?

Post by Anonymous »

Warum kann der Linker keine Absl-Referenzen finden?
Konfiguration:
Raspberry Pi 4 Model B (AArch64) |
Ubuntu Server 20.04 |
Clang++ (llvm 13.0.0) |
GRPC v1.41.1 (libprotoc 3.17.3)
GRPC mit diesen Optionen installiert:

Code: Select all

cmake -DgRPC_INSTALL=ON -DCMAKE_BUILD_TYPE=Release -DgRPC_ABSL_PROVIDER=module -DgRPC_CARES_PROVIDER=module -DgRPC_PROTOBUF_PROVIDER=module -DgRPC_RE2_PROVIDER=module -DgRPC_SSL_PROVIDER=module -DgRPC_ZLIB_PROVIDER=module -j4 ../

sudo make install
Befehl:

Code: Select all

clang++ -std=c++17 -iquote /home/ubuntu/gameserver/server/include -include /usr/local/include/grpcpp/support/method_handler.h -L /usr/local/lib src/gameserver.pb.cc src/gameserver.grpc.pb.cc server_test.cpp -lprotobuf -lpthread -ljsoncpp -lgrpc -lgrpc++ -lgrpc++_reflection -labsl_base -labsl_synchronization -labsl_malloc_internal -labsl_stacktrace -labsl_raw_logging_internal -labsl_time -labsl_graphcycles_internal -labsl_spinlock_wait -lgrpc_unsecure -lz -labsl_symbolize -lgpr -labsl_status -labsl_statusor -o server_test -v -Wl,--verbose
Linker findet Basisklasse (Gefunden in diesem [Header][1]):

Code: Select all

/usr/local/lib/libabsl_base.a
Fehler:

Code: Select all

/usr/bin/ld: /usr/local/lib/libabsl_synchronization.a(mutex.cc.o): in function 'absl::lts_20210324::EnsureSynchEvent(std::atomic*, char const*, long, long)':
mutex.cc:(.text+0x1f0): undefined reference to 'absl::lts_20210324::base_internal::SpinLock::SlowUnlock(unsigned int)'
Update Nr. 1:
grpc und absl mit -DCMAKE_CXX_STANDARD=17 neu erstellt/installiert, nur um sicherzustellen, dass alles auf dem gleichen Standard ist.
Neuer Fehler beim Ändern der Reihenfolge verknüpfter Bibliotheken gefunden...
Neuer Befehl:

Code: Select all

clang++ -iquote /home/ubuntu/gameserver/server/include -include /usr/local/include/grpcpp/support/method_handler.h -L /usr/local/lib src/gameserver.pb.cc src/gameserver.grpc.pb.cc server_test.cpp -o server_test -labsl_status -labsl_strings -lgrpc -lgrpc++ -labsl_synchronization -lgrpc_unsecure -labsl_base -lprotobuf -lpthread -ljsoncpp -lgrpc++_reflection   -labsl_malloc_internal -labsl_stacktrace -labsl_raw_logging_internal -labsl_time -labsl_graphcycles_internal -labsl_spinlock_wait  -lz -labsl_symbolize -lgpr  -labsl_statusor  -std=c++17 -v -Wl,--verbose
Neue Fehler:

Code: Select all

/usr/bin/ld: /usr/local/lib/libgrpc_unsecure.a(client_channel.cc.o): in function `grpc_core::ClientChannel::LoadBalancedCall::RecvTrailingMetadataReady(void*, grpc_error*)':
client_channel.cc:(.text+0x774): undefined reference to `absl::lts_20210324::Status::Status(absl::lts_20210324::StatusCode, std::basic_string_view)'
/usr/bin/ld: client_channel.cc:(.text+0x8d8): undefined reference to `absl::lts_20210324::Status::Status(absl::lts_20210324::StatusCode, std::basic_string_view)'
/usr/bin/ld: client_channel.cc:(.text+0x8e8): undefined reference to `absl::lts_20210324::Status::UnrefNonInlined(unsigned long)'
/usr/bin/ld: client_channel.cc:(.text+0x918): undefined reference to `absl::lts_20210324::Status::UnrefNonInlined(unsigned long)'
/usr/bin/ld: client_channel.cc:(.text+0x930): undefined reference to `absl::lts_20210324::Status::UnrefNonInlined(unsigned long)'
/usr/bin/ld: client_channel.cc:(.text+0xa2c): undefined reference to `absl::lts_20210324::Status::UnrefNonInlined(unsigned long)'
/usr/bin/ld: client_channel.cc:(.text+0xa38): undefined reference to `absl::lts_20210324::Status::UnrefNonInlined(unsigned long)'
/usr/bin/ld: /usr/local/lib/libgrpc_unsecure.a(client_channel.cc.o):client_channel.cc:(.text+0xa54): more undefined references to `absl::lts_20210324::Status::UnrefNonInlined(unsigned long)' follow
/usr/bin/ld: /usr/local/lib/libgrpc_unsecure.a(client_channel.cc.o): in function `std::_Function_handler::_M_invoke(std::_Any_data const&, grpc_core::LoadBalancingPolicy::PickResult::Drop*&&)':
client_channel.cc:(.text+0x354c): undefined reference to `absl::lts_20210324::Status::ToStringSlow[abi:cxx11](absl::lts_20210324::StatusToStringMode) const'
/usr/bin/ld: client_channel.cc:(.text+0x3590): undefined reference to `absl::lts_20210324::Status::UnrefNonInlined(unsigned long)'
/usr/bin/ld: /usr/local/lib/libgrpc_unsecure.a(client_channel.cc.o): in function `std::_Function_handler::_M_invoke(std::_Any_data const&, grpc_core::LoadBalancingPolicy::PickResult::Fail*&&)':

Update Nr. 2:
Absl neu erstellt/installiert mit -DCMAKE_CXX_FLAGS='-D_GLIBCXX_USE_CXX11_ABI=0' wie erwähnt [hier][2].
Immer noch der gleiche Fehler wie bei Update Nr. 1.

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post