trlsmax / imgui-vtk

test on how to integrate vtk into glfw + imgui project
MIT License
107 stars 26 forks source link

Warning: Link to vtkInteractionStyle for default style selection #2

Closed jspanchu closed 3 years ago

jspanchu commented 3 years ago

vtk_module_autoinit is needed from vtk 9.0.0 onwards vtk_autinit

trlsmax commented 3 years ago

Supports for vtk 9.0 and 8.2.0 is ok now.

Ilmu011 commented 2 years ago

Sorry, but I am getting this same error message when trying to execute this basic example: https://kitware.github.io/vtk-examples/site/Cxx/GeometricObjects/CylinderExample/ and I have no idea what is going wrong.

What is the cause of this error?

I installed vtk with vcpkg and built it with Visual Studio

jspanchu commented 2 years ago

Do you mean that example itself doesn't work for you or did you paste that code in main.cpp of this repository and that does not work for you? If it is the former, then maybe you need to look into your VTK installation and path environment.

Ilmu011 commented 2 years ago

The example itself didn't work for me. I realize this is probably irrelevant to this repository but this is the only place I found that mentions the exact error I am getting.

I installed VTK with vcpkg and that should have taken care of all dependencies (I thought).

As suggested here, I tried to use autoinit by adding these lines at the top of my code:

#include <vtk-9.0/vtkAutoInit.h>

VTK_MODULE_INIT(vtkInteractionStyle);

This did get rid of the error, but instead of an error, now no window appears at all.

Do you have an idea what could be going wrong here?

Maybe it's worth noting, that I tried to run the python-version of this example by installing VTK via the PyCharm package manager and that just worked fine, so i'm not sure what's going wrong with the vcpkg installation.

AlexRablau commented 2 years ago

Same exact problem in 2022.

What is going on? I am not running the python version. C++ VTK installed through vcpkg, with a cmake project, built on Windows.