Domanda

I managed to compile VTK example (http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/Curvatures) in MSVS 2010 but when I tried to run it, it stopped. Does anyone know the cause? I can run other VTK examples successfully but not this one. enter image description here

È stato utile?

Soluzione

From the comments, the problem is caused by using Release .dlls in a Debug application. Remember that the Release heap is not compatible to the Debug heap. Which means any allocations in the Release heap can not be freed in the Debug heap or vise versa. As a result of this it is not generally safe to mix Debug and Release in the same application.

Now in the case of VTK (since I have used this on many machines and have built this 100s of times using Visual Studio over the last 5+ years) my recommendations are to turn off the building of shared libraries with vtk. And avoid the use the INSTALL target with for VTK, ITK, GDCM or any CMake based library that names its release libraries the same as its debug libraries. Instead use BUILD_ALL for all configurations you will need in your application. Then when you need to configure your application to use CMake I point VTK_DIR to the root directory of the folder where I built VTK and CMake will then correctly use the Debug libraries in my Debug application, Release libraries in my Release application..

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top