Install VTK 6.2.0 with Qt 5.4 using CMake-GUI 3.2.2

徘徊边缘 提交于 2019-12-25 03:34:39

问题


This is the first time I try to use Vtk libraries but I can not find a tutorial that can help me with the qt integration. I tried several tutorials but when I try to write some code, qt can not find vtk libraries. I followed this post but something doesn't work correctly: Combining Qt 5.4.1 with vtk 6.2.0 (using CMake GUI 3.2.1) on windows Can someone explain me the correct procedure? I'm using Windows 7 64 bit, VTK 6.2.0, QT 5.4 and CMake-GUI 3.2.2. Thanks to all who respond!


回答1:


Did you build the vtk solution in debug or release? In the example you linked (it was me), I did it in debug, so it will only work in debug (until I build it in release)

also, maybe it's your cMakeList the problem. Did you manage to launch the project EasyView from the vtk solution?

Finally, the tutorial I followed was this one : http://www.vtk.org/Wiki/VTK/Tutorials/QtSetup

The only thing I had to modify, was to change the qt version to 5, add another entry cmake_prefix and set up several environment variables.




回答2:


Try to create Qt project with cmake instead of qmake like is described here

For a first step try to write just hello world in Qt and try to create cmake for it..

Then you just add the VTK find functions and use those to add vtk support to your qt cmake project. Maybe its something like this (never used vtk):

FIND_PACKAGE(VTK REQUIRED)
INCLUDE(${VTK_USE_FILE})

Then you should be able to use Qt and vtk in same project..



来源:https://stackoverflow.com/questions/30252858/install-vtk-6-2-0-with-qt-5-4-using-cmake-gui-3-2-2

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!