Hi protobuf experts,

I am trying to use protobuf static libraries with cmake configurations.
Now it can build and run successfully for windows and mac.
But for linux, I always get the unresolved link errors as below, can anyone 
help on this?

link errors: 

/opt/rh/gcc-toolset-12/root/usr/libexec/gcc/x86_64-redhat-linux/12/ld: 
/mnt/data/atf3p/ref/Debug/ATF-3P-PROTOBUF-lib/libs/libabsl_log_globals.a(globals.cc.o):
 
in function 
`absl::lts_20240116::hash_internal::MixingHashState::MixingHashState()':
globals.cc:(.text._ZN4absl12lts_2024011613hash_internal15MixingHashStateC2Ev[_ZN4absl12lts_2024011613hash_internal15MixingHashStateC5Ev]+0xb):
 
undefined reference to 
`absl::lts_20240116::hash_internal::MixingHashState::kSeed'
/opt/rh/gcc-toolset-12/root/usr/libexec/gcc/x86_64-redhat-linux/12/ld: 
/mnt/data/atf3p/ref/Debug/ATF-3P-PROTOBUF-lib/libs/libabsl_log_globals.a(globals.cc.o):
 
in function 
`absl::lts_20240116::hash_internal::MixingHashState::CombineContiguousImpl(unsigned
 
long, unsigned char const*, unsigned long, std::integral_constant<int, 8>)':
globals.cc:(.text._ZN4absl12lts_2024011613hash_internal15MixingHashState21CombineContiguousImplEmPKhmSt17integral_constantIiLi8EE[_ZN4absl12lts_2024011613hash_internal15MixingHashState21CombineContiguousImplEmPKhmSt17integral_constantIiLi8EE]+0x66):
 
undefined reference to 
`absl::lts_20240116::hash_internal::MixingHashState::CombineLargeContiguousImpl64(unsigned
 
long, unsigned char const*, unsigned long)'
/opt/rh/gcc-toolset-12/root/usr/libexec/gcc/x86_64-redhat-linux/12/ld: 
globals.cc:(.text._ZN4absl12lts_2024011613hash_internal15MixingHashState21CombineContiguousImplEmPKhmSt17integral_constantIiLi8EE[_ZN4absl12lts_2024011613hash_internal15MixingHashState21CombineContiguousImplEmPKhmSt17integral_constantIiLi8EE]+0x94):
 
undefined reference to 
`absl::lts_20240116::hash_internal::MixingHashState::LowLevelHashImpl(unsigned 
char const*, unsigned long)'
/opt/rh/gcc-toolset-12/root/usr/libexec/gcc/x86_64-redhat-linux/12/ld: 
/mnt/data/atf3p/ref/Debug/ATF-3P-PROTOBUF-lib/libs/libabsl_symbolize.a(symbolize.cc.o):
 
in function `absl::lts_20240116::InitializeSymbolizer(char const*)':
symbolize.cc:(.text+0xd): undefined reference to 
`absl::lts_20240116::debugging_internal::VDSOSupport::Init()'
/opt/rh/gcc-toolset-12/root/usr/libexec/gcc/x86_64-redhat-linux/12/ld: 
/mnt/data/atf3p/ref/Debug/ATF-3P-PROTOBUF-lib/libs/libabsl_symbolize.a(symbolize.cc.o):
 
in function `absl::lts_20240116::debugging_internal::DemangleInplace(char*, 
unsigned long, char*, unsigned long)':
symbolize.cc:(.text+0x26da): undefined reference to 
`absl::lts_20240116::debugging_internal::Demangle(char const*, char*, 
unsigned long)'
/opt/rh/gcc-toolset-12/root/usr/libexec/gcc/x86_64-redhat-linux/12/ld: 
/mnt/data/atf3p/ref/Debug/ATF-3P-PROTOBUF-lib/libs/libabsl_symbolize.a(symbolize.cc.o):
 
in function `absl::lts_20240116::debugging_internal::(anonymous 
namespace)::Symbolizer::GetUncachedSymbol(void const*)':
symbolize.cc:(.text+0x3299): undefined reference to 
`absl::lts_20240116::debugging_internal::VDSOSupport::VDSOSupport()'
/opt/rh/gcc-toolset-12/root/usr/libexec/gcc/x86_64-redhat-linux/12/ld: 
symbolize.cc:(.text+0x32d0): undefined reference to 
`absl::lts_20240116::debugging_internal::VDSOSupport::LookupSymbolByAddress(void
 
const*, absl::lts_20240116::debugging_internal::ElfMemImage::SymbolInfo*) 
const'
/opt/rh/gcc-toolset-12/root/usr/libexec/gcc/x86_64-redhat-linux/12/ld: 
../../../Bin/Debug/_UTatfapi_atfapi: hidden symbol 
`_ZN4absl12lts_2024011624synchronization_internal11GraphCycles10InsertEdgeENS1_7GraphIdES3_'
 
in 
/mnt/data/atf3p/ref/Debug/ATF-3P-PROTOBUF-lib/libs/libabsl_graphcycles_internal.a(graphcycles.cc.o)
 
is referenced by DSO
/opt/rh/gcc-toolset-12/root/usr/libexec/gcc/x86_64-redhat-linux/12/ld: 
final link failed: bad value
collect2: error: ld returned 1 exit status

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/e7349b9d-5e67-4d7f-9c42-a95f85d2e67en%40googlegroups.com.

Reply via email to