I’m upgrading a C++/CLI .NET application from VTK 8.1 to 9.2.6.
I’m now getting many compile errors:
fatal error C1189: #error:
<mutex>
is not supported when compiling with /clr or /clr:pure.
…which I’ve tracked down to a change in vtkAbstractTransform.h to move from vtkSimpleCriticalSection to std::mutex
(in version 9.1 I think).
It seems like there is no possibility to compile code including vtkTransform.h using the /clr option because it indirectly #includes <mutex>
.
The advice is to refactor my code to isolate any VTK code to files built without /clr, but honestly I don’t see how to do that yet - to say the least it will be a major refactoring if it’s possible at all.
Has anyone else hit up against this? It seems like it would be pretty commonplace for anyone using C++/CLI. Can anyone suggest a straightforward workaround?