I am building the latest release of cesium-native on Linux and then linking the built static libraries to my own library. When I try to load my library I get a UnsatisfiedLinkError
:
java.lang.UnsatisfiedLinkError: libmyengine.so: undefined symbol: _ZN4absl12lts_2024072216numbers_internal9kHexTableE
This points to the abseil libraries, and specifically this symbol is found in libabsl_str_format_internal.a
:
nm libabsl_str_format_internal.a | grep _ZN4absl12lts_2024072216numbers_internal9kHexTableE
U _ZN4absl12lts_2024072216numbers_internal9kHexTableE
nm -C libabsl_str_format_internal.a | grep HexTable
U absl::lts_20240722::numbers_internal::kHexTable
Strangely, when I check my library I can also see the symbol there:
nm libmyengine.so | grep _ZN4absl12lts_2024072216numbers_internal9kHexTableE
U _ZN4absl12lts_2024072216numbers_internal9kHexTableE
nm -C libmyengine.so | grep HexTable
U absl::lts_20240722::numbers_internal::kHexTable
Some additional verification:
readelf -aW libmyengine.so | grep _ZN4absl12lts_2024072216numbers_internal9kHexTableE
0000000001476140 0000000400000006 R_X86_64_GLOB_DAT 0000000000000000 _ZN4absl12lts_2024072216numbers_internal9kHexTableE + 0
4: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND _ZN4absl12lts_2024072216numbers_internal9kHexTableE
14438: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND _ZN4absl12lts_2024072216numbers_internal9kHexTableE
scanelf libmyengine.so -s _ZN4absl12lts_2024072216numbers_internal9kHexTableE
TYPE SYM FILE
ET_DYN _ZN4absl12lts_2024072216numbers_internal9kHexTableE libmyengine.so
Note that I am successfully building and running on both Windows and Android without this issue. I feel like there is something subtle about the building process that I am missing. I don’t believe it is this one abseil symbol in particular, but probably the whole way it’s being built. I have checked the Linux build CI scripts on github and tried to mirror them. The cesium-native build command line is approximately (I’ve tried a few variations):
cmake -B build -S cesium-native -DCMAKE_INSTALL_PREFIX=build/linux-x86_64 -DVCPKG_TRIPLET=x64-linux -DCMAKE_BUILD_TYPE=Release -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCESIUM_TESTS_ENABLED=OFF
My library is also using cmake for its build and adding all the output libraries (including all abseil libraries) from cesium-native.
Can anyone provide some guidance or point me in the right direction? Should I escalate this to a github issue? Thank you!