Link failure w.r.t. pugixml
While trying to build VTK 9.0.1, I get the following errors:
[1/88] Linking CXX shared library lib64/libvtkIOCityGML-9.0.so.9.0.1
FAILED: lib64/libvtkIOCityGML-9.0.so.9.0.1
: && /usr/lib64/ccache/c++ -fPIC -std=c++11 -O2 -g -DNDEBUG -Wl,-lc -Wl,--no-undefined -shared -Wl,-soname,libvtkIOCityGML-9.0.so.1 -o lib64/libvtkIOCityGML-9.0.so.9.0.1 IO/CityGML/CMakeFiles/IOCityGML.dir/vtkCityGMLReader.cxx.o -Wl,-rpath,<build>/lib64: lib64/libvtkFiltersModeling-9.0.so.9.0.1 lib64/libvtkFiltersGeneral-9.0.so.9.0.1 lib64/libvtkFiltersCore-9.0.so.9.0.1 lib64/libvtkCommonExecutionModel-9.0.so.9.0.1 lib64/libvtkCommonDataModel-9.0.so.9.0.1 lib64/libvtkCommonTransforms-9.0.so.9.0.1 lib64/libvtkCommonMisc-9.0.so.9.0.1 lib64/libvtkCommonMath-9.0.so.9.0.1 lib64/libvtkCommonCore-9.0.so.9.0.1 -lpthread lib64/libvtksys-9.0.so.9.0.1 -ldl -Wl,-rpath-link,<build>/lib64 && :
/usr/bin/ld: IO/CityGML/CMakeFiles/IOCityGML.dir/vtkCityGMLReader.cxx.o: in function `vtkCityGMLReader::RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*)':
<source>/IO/CityGML/vtkCityGMLReader.cxx:1053: undefined reference to `pugi::xml_document::xml_document()'
/usr/bin/ld: <source>/IO/CityGML/vtkCityGMLReader.cxx:1054: undefined reference to `pugi::xml_document::load_file(char const*, unsigned int, pugi::xml_encoding)'
/usr/bin/ld: <source>/IO/CityGML/vtkCityGMLReader.cxx:1057: undefined reference to `pugi::xml_parse_result::operator bool() const'
/usr/bin/ld: <source>/IO/CityGML/vtkCityGMLReader.cxx:1061: undefined reference to `pugi::xml_parse_result::description() const'
/usr/bin/ld: <source>/IO/CityGML/vtkCityGMLReader.cxx:1053: undefined reference to `pugi::xml_document::~xml_document()'
...many more similar undefined references...
I am using system pugixml. Note that the link line contains no reference to pugixml, despite that the module has a PRIVATE_DEPENDS
on VTK::pugixml
. Unfortunately, it is not easy to debug VTK's rather esoteric build system.
This is likely to be an issue for distribution packaging as well, since using the bundled pugixml is not an option.