[gdal-dev] cmake ignores EXPAT_INCLUDE_DIR & EXPAT_LIBRARY
Nik Sands
nik at nixanz.com
Fri Jul 8 15:42:05 PDT 2022
Hi Gaige,
Doh! It was libxml2, not libexpat. Thanks for pointing me in this direction.
Somehow, I hadn’t noticed the need for libxm2l in GDAL 3.x, as it was not in my iOS project which was working fine with GDAL 2.2.2 (or otherwise, it has somehow been removed from the project - perhaps when I did a clean up of unnecessary libraries).
The the libexpat guess was completely wrong. It was all libxml2.
Now that I’ve added libxml2.tbd to the project, it builds fine.
Just FYI, as requested, the list of symbols is below (as reported by XCode when attempting to replace my old GDAL 2.2.2 library with my new GDAL 3.5 library).
I will remove my custom libexpat (attempt) from my GDAL cmake build process again.
Cheers,
Nik.
Undefined symbol: _xmlCatalogResolveSystem
Undefined symbol: _xmlNewStringInputStream
Undefined symbol: _xmlGetLastError
Undefined symbol: _xmlGetExternalEntityLoader
Undefined symbol: _xmlFree
Undefined symbol: _xmlSchemaNewMemParserCtxt
Undefined symbol: _xmlSchemaSetParserErrors
Undefined symbol: _xmlCatalogResolveURI
Undefined symbol: _xmlSetExternalEntityLoader
Undefined symbol: _xmlSchemaFreeParserCtxt
Undefined symbol: _xmlSchemaNewValidCtxt
Undefined symbol: _xmlSchemaValidateFile
Undefined symbol: _xmlSchemaSetValidErrors
Undefined symbol: _xmlSchemaParse
Undefined symbol: _xmlParseDoc
Undefined symbol: _xmlSchemaValidateDoc
Undefined symbol: _xmlFreeDoc
Undefined symbol: _xmlSchemaFreeValidCtxt
Undefined symbol: _xmlSchemaFree
> On 8 Jul 2022, at 8:59 pm, Gaige B. Paulsen <osgeo at gbp.gaige.net> wrote:
>
> Nik,
>
> Which symbols is the linker complaining about? I build regularly for iOS (although not using CMake directly), linking with the system copy of libxpat and libxml2 and I haven’t noticed any link or operational failures in 3.5.0. Admittedly, I use a subset of the drivers, but if you can send the linker errors, I can check to see why I'm not having the problem you are, maybe it'll give us a clue.
>
> Cheers,
> -Gaige
>
>
> On 2022-07-07 20:38, Nik Sands wrote:
>> Hi GDAL devs,
>> I’ve built GDAL 3.5 for iOS (device and simulator) but I’ve found that
>> when incorporating libgdal into my iOS app, there are several errors
>> related to undefined symbols, all of which are XML related.
>> My guess is that the libexpat included in Apple’s SDK is missing some
>> symbols that GDAL requires, therefore I’ve now built my own libexpat.
>> Now I’m attempting to rebuild GDAL using my own libexpat, using the
>> cmake configuration command:
>> ==========
>> cmake -DCMAKE_TOOLCHAIN_FILE=$CMTOOLCHAIN \
>> -DPLATFORM=$OS \
>> -DENABLE_BITCODE=OFF \
>> -DCMAKE_INSTALL_PREFIX=$PREFIX \
>> -DBUILD_APPS=OFF \
>> -DBUILD_SHARED_LIBS=OFF \
>> -DBUILD_PYTHON_BINDINGS=OFF \
>> -DPROJ_ROOT=$PREFIX \
>> -DEXPAT_INCLUDE_DIR=$PREFIX/include \
>> -DEXPAT_LIBRARY=$PREFIX/lib/libexpat.dylib \
>> -DSQLITE3_INCLUDE_DIR=$PREFIX/include \
>> -DSQLITE3_LIBRARY=$PREFIX/lib/libsqlite3.a \
>> -DIconv_INCLUDE_DIR=$SDKPATH/usr \
>> -DIconv_LIBRARY=$SDKPATH/usr/lib/libiconv.tbd \
>> -DCMAKE_BUILD_TYPE=Release \
>> ..
>> ==========
>> However, when this completes, it tells me that it has ignored the two
>> libexpat arguments that I supplied to it:
>> ==========
>> -- Configuring done
>> -- Generating done
>> CMake Warning:
>> Manually-specified variables were not used by the project:
>> EXPAT_INCLUDE_DIR
>> EXPAT_LIBRARY
>> -- Build files have been written to: ...
>> ==========
>> Why would it be ignoring these arguments and how can I get it to use
>> my own libexpat instead of the default SDK libexpat?
>> Cheers,
>> Nik.
>> _______________________________________________
>> gdal-dev mailing list
>> gdal-dev at lists.osgeo.org
>> https://lists.osgeo.org/mailman/listinfo/gdal-dev
More information about the gdal-dev
mailing list