I am working with C++ in VS 2019 Community Edition.
I built and installed VTK-9.1.0.rc4. Afterwards, I wanted to try to verify using one of the examples. I grabbed the ReadOBJ example, configured, and built it. It throws an exception at line 31 while calling
In an attempt to troubleshoot this, I built the debug version of VTK and linked the ReadOBJ example against that. The example launches with no problems using the debug version of the libraries.
I am getting similar result when I do:
vtkNew colors;
double rgba[4]{ 0.0, 0.0, 0.0, 0.0 };
colors->GetColor(“Carrot”, rgba);
the code crashes with message: “Exception thrown at 0x00007FFBC30CA370 (vtkCommonColor-9.2.dll) in VolumeRendering.exe: 0xC0000005: Access violation reading location 0x000000DF04100000.”
That is a very strange crash. I’ve tried your code and it appears to work. Can you test if it works in isolation like below? It may be a problem with your project build configuration or something overwrites memory before control reaches there.