I have been trying to link a code to vtk using gcc-11.2.0.
The link fails with
/usr/bin/ld: /…/vtk4ctk-8.1.0-sersh/lib/libvtkCommonExecutionModel-8.1.so.1: undefined reference to `vtkCollectionIterator::GoToFirstItem()’
…
but I see that in vtkCommonCore, which is present on the link line (see attached build log), is installed. However, nm shows
$ nm -CB libvtkCommonCore-8.1.so | grep GoToFirstItem
00000000000e4b10 t vtkCollectionIterator::GoToFirstItem()
00000000001b3f30 t vtkInformationIterator::GoToFirstItem()
0000000000063ab0 t vtkInformationIterator::GoToFirstItem() [clone .cold]
that this symbol, while present, is local to the library. Hence, the link fails.
This is not a problem with gcc-8.3.0 on this machine or gcc-9.4.0 on a different machine.
This is a problem with gcc-10.3.0, gcc-11.2.0, which it seems I need to use to get the C++ features that I want.
Same problem occurs for vtk-8.2.0.
How do I make these symbols not local to the library?
Thx…John Cary