Libgdal.so has undefined symbol

Hi Terry,

Having analyzed your issue very thoroughly, please do the following:

Check if you are including ubuntugis ppa via:
$ sudo apt policy | grep gis
If so, please comment them out in /etc/apt/sources.list.d/ubuntugis-ubuntu-ppa-bionic.list.

apt remove gdal-bin libxerces-c3.2

apt autoremove && sudo apt update

rm /usr/lib/libxerces-c*

apt install gdal-bin

Keep on reading if you want to get a deeper insight…

Comparing Ubuntu Xenial Xerus to Bionic Beaver I found out a change in the released libxerces-c-dev packages:
xercesc_3_1::InputSource::setEncoding(unsigned short const*) to
xercesc_3_2::InputSource::setEncoding(char16_t const*)

Now when listing the symbols from the shared object files on the device, we see

$ nm /usr/lib/libxerces-c-3.2.so | grep setEnc
00000000002e2a04 T _ZN11xercesc_3_211InputSource11setEncodingEPKt
000000000023e06c T _ZN11xercesc_3_214DOMLSInputImpl11setEncodingEPKt
000000000023e4dc T _ZN11xercesc_3_215DOMLSOutputImpl11setEncodingEPKt
000000000035b324 W _ZN11xercesc_3_217SchemaElementDecl17setEnclosingScopeEj
0000000000257130 T _ZN11xercesc_3_218Wrapper4DOMLSInput11setEncodingEPKt
000000000025783c T _ZN11xercesc_3_219Wrapper4InputSource11setEncodingEPKt
00000000002afbf4 W _ZN11xercesc_3_220XSElementDeclaration24setEnclosingCTDefinitionEPNS_23XSComplexTypeDefinitionE
00000000002afc6c W _ZN11xercesc_3_222XSAttributeDeclaration24setEnclosingCTDefinitionEPNS_23XSComplexTypeDefinitionE
0000000000364544 T _ZN11xercesc_3_224XMLSchemaDescriptionImpl23setEnclosingElementNameEPNS_5QNameE
000000000029db6c T _ZN11xercesc_3_29XMLReader11setEncodingEPKt

The first function name shows the letter “t” at the very end which indicates an old implementation.
Additionally, following the .deb package provided for arm64, see 3.2.0+debian-2 : libxerces-c-dev : arm64 : Bionic (18.04) : Ubuntu, one would expect it to be located under /usr/lib/aarch64-linux-gnu.
As the PATH variable got appended by /usr/lib/aarch64-linux-gnu it will check its location at last and as we also don’t have any use for the old library we can securely remove it with # rm /usr/lib/libxerces-c*.

Hope I could shed some light to you and that you are enabled to continue developing.

Thanks,
Fabian