Build Fails for 8.1.1 with Python 3.7 Wrapping
Building VTK 8.1.1 with VTK_WRAP_PYTHON=ON
fails with the following error:
VTK-8.1.1/Wrapping/PythonCore/vtkPythonArgs.cxx:105:9: error: assigning to 'char *' from incompatible type 'const char *'
a = PyUnicode_AsUTF8(o);
^~~~~~~~~~~~~~~~~~~
VTK-8.1.1/Wrapping/PythonCore/vtkPythonArgs.cxx:311:11: note: in
instantiation of function template specialization 'vtkPythonGetStringValue<char>' requested here
vtkPythonGetStringValue(o, a, "string or None required"));
^
Changing line 105 in vtkPythonArgs.cxx to
a = const_cast<char*>(PyUnicode_AsUTF8(o));
removes the error.
I am using MacOS 10.13.5 with Clang 9.1.0.
Update: it is most likely related to the new const
return type of PyUnicode_AsUTF8
in python 3.7 rather than the VTK version.
Edited by David Gobbi