I’m having trouble building our app against VTK master on OSX,
It fails with that error while linking :
Undefined symbols for architecture x86_64:
"vtkConvertSelection::ToSelectionType(vtkSelection*, vtkDataObject*, int, vtkStringArray*, int, bool)", referenced from:
vtkQtTreeModelAdapter::mimeData(QList<QModelIndex> const&) const in libvtkGUISupportQt-8.90.a(vtkQtTreeModelAdapter.o)
vtkQtTableModelAdapter::mimeData(QList<QModelIndex> const&) const in libvtkGUISupportQt-8.90.a(vtkQtTableModelAdapter.o)
ld: symbol(s) not found for architecture x86_64
Am I missing a VTK library ? Or some module init ?
VTK master, Qt 5.9.4, Xcode 10
Yes the Qt headers are always those from Qt-5.9.4.
We don’t use that part of the code, so I ended up patching VTK sources and remove the call to vtkConvertSelection::ToSelectionType that results in those undefined symbol.
We must be doing something wrong somewhere but I couldn’t find some other solution.
Thanks
I think you’d also need to remove the declaration from the class. But this seems odd anyways. Does vtkConvertSelection have a ToSelectionType implementation in its .cxx file?
Yes, I can see the implementation of the method ToSelectionType in vtkConvertSelection.cxx
Under OSX, we’re building VTK statically. Can this be the root of the pb ?
Here is the pseudo patch applied
QMimeData *vtkQtTableModelAdapter::mimeData(const QModelIndexList &indexes) const
{
// Only supports dragging single item right now ...
if(indexes.size() == 0)
{
return nullptr;
}
/*
vtkSmartPointer<vtkSelection> indexSelection = vtkSmartPointer<vtkSelection>::Take(QModelIndexListToVTKIndexSelection(indexes));
//vtkSmartPointer<vtkSelection> pedigreeIdSelection = vtkSmartPointer<vtkSelection>::Take(vtkConvertSelection::ToSelectionType(indexSelection, this->Table, vtkSelectionNode::PEDIGREEIDS));
// This is a memory-leak, we need to serialize its contents as a string, instead of serializing a pointer to the object
vtkSelection* pedigreeIdSelection = vtkConvertSelection::ToSelectionType(indexSelection, this->Table, vtkSelectionNode::PEDIGREEIDS);
if(pedigreeIdSelection->GetNode(0) == nullptr || pedigreeIdSelection->GetNode(0)->GetSelectionList()->GetNumberOfTuples() == 0)
{
return nullptr;
}
*/
std::ostringstream buffer;
//buffer << pedigreeIdSelection;
QMimeData *mime_data = new QMimeData();
mime_data->setData("vtk/selection", buffer.str().c_str());
return mime_data;
}
And here is the relevant part of our cmake superbuild script to build VTK