# building VTK in windows 10, visual studio 2019, lways crashes what am i doing wrong?

**URL:** https://discourse.vtk.org/t/building-vtk-in-windows-10-visual-studio-2019-lways-crashes-what-am-i-doing-wrong/7105
**Category:** Support
**Created:** [November 8, 2021, 6:40am UTC](https://discourse.vtk.org/t/building-vtk-in-windows-10-visual-studio-2019-lways-crashes-what-am-i-doing-wrong/7105 "2021-11-08T06:40:23Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![cebugdev](https://discourse.vtk.org/user_avatar/discourse.vtk.org/cebugdev/32/7803_2.png) [@cebugdev](https://discourse.vtk.org/u/cebugdev)
#### Post date: [November 8, 2021, 6:40am UTC](https://discourse.vtk.org/t/building-vtk-in-windows-10-visual-studio-2019-lways-crashes-what-am-i-doing-wrong/7105/1 "2021-11-08T06:40:23Z")

</div>

I have followed various tutorials including one where I build it with QT

[![](https://discourse.vtk.org/uploads/default/original/2X/c/c7f6b10ccbd4dc1629892bdedebf04759284923d.jpeg "How to use VTK with Qt using CMake and Visual Studio 2017 - 1 of 3") ](https://www.youtube.com/watch?v=u5-Df1YlxCI)

and building it as a standalone

> <https://github.com/martijnkoopman/Qt-VTK-viewer/blob/master/doc/Build-VTK.md>

or running a stand alone application without QT

[![](https://discourse.vtk.org/uploads/default/original/2X/b/bcca221943feefb0d57ad91399c1925be069637f.jpeg "VTK setup in windows") ](https://www.youtube.com/watch?v=IgvbhyDh8r0)

I even just copy and pasted the sample from here:  
[https://kitware.github.io/vtk-examples/site/Cxx/GeometricObjects/CylinderExample/](https://kitware.github.io/vtk-examples/site/Cxx/GeometricObjects/CylinderExample/)

But everytime i run an application including the one from above, i get CRASHES on mere declaration alone.

here is the crash when using the CylinderExample from above.  
|

 ![image](https://discourse.vtk.org/uploads/default/original/2X/6/619653f8083f3b1df350be0b7900df438d7a108d.png)

I tried building the latest 9.1.0 and even the version before that VTK-8.2.0  
I cant seem to make it work!

when using QT, and declaring a QVTKOpenGLWidget, the crash is in the constructor itself, Exception occured yada yada.

What am i doing wrong to get myself started with VTK?  
this is just sad, I already spent a whole day just setting this one up

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [November 9, 2021, 7:55pm UTC](https://discourse.vtk.org/t/building-vtk-in-windows-10-visual-studio-2019-lways-crashes-what-am-i-doing-wrong/7105/2 "2021-11-09T19:55:58Z")

</div>

This most commonly happens when your test application finds some unrelated VTK DLLs in your path.

In general, it is advisable to keep your PATH environment variable mostly empty (have nothing but some Windows system folders). If you want to make sure your executable does not pick up unrelated DLLs then you can put the DLLs in the same folder as the executable, or use manifests.
