I'm new to vtk, so I started by building vtk 8.1.1 with CMake and Visual Studio 2017, with the default options and the examples.
Many of the examples runs fine, but some of them gives an error:
This one is the CreateTree example, but the HelloWorld gives the same error.
I don't know if it has something to do with this issue.
I've also tried the solution from this question and this one. But when I add
#include <vtkAutoInit.h>
VTK_MODULE_INIT(vtkRenderingOpenGL2);
right after all the includes, Visual Studio gives me this error:
1>CreateTree.obj : error LNK2019: unresolved external symbol "void __cdecl vtkRenderingOpenGL2_AutoInit_Construct(void)" (?vtkRenderingOpenGL2_AutoInit_Construct@@YAXXZ) referenced in function "public: __thiscall vtkRenderingOpenGL2_ModuleInit::vtkRenderingOpenGL2_ModuleInit(void)" (??0vtkRenderingOpenGL2_ModuleInit@@QAE@XZ)
1>CreateTree.obj : error LNK2019: unresolved external symbol "void __cdecl vtkRenderingOpenGL2_AutoInit_Destruct(void)" (?vtkRenderingOpenGL2_AutoInit_Destruct@@YAXXZ) referenced in function "public: __thiscall vtkRenderingOpenGL2_ModuleInit::~vtkRenderingOpenGL2_ModuleInit(void)" (??1vtkRenderingOpenGL2_ModuleInit@@QAE@XZ)
1>C:\vtkSource\bin\bin\Debug\CreateTree.exe : fatal error LNK1120: 2 unresolved externals
if I try VTK_MODULE_INIT(vtkRenderingWindow) or VTK_MODULE_INIT(vtkRenderingOpenGL) I get the same errors.
Also, examples like Delaunay3D only open a window that closes so fast I can't even see what it does have.

