简体   繁体   English

使用CMake-GUI 3.2.2在Qt 5.4上安装VTK 6.2.0

[英]Install VTK 6.2.0 with Qt 5.4 using CMake-GUI 3.2.2

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. 这是我第一次尝试使用Vtk库,但找不到适合qt集成的教程。 I tried several tutorials but when I try to write some code, qt can not find vtk libraries. 我尝试了一些教程,但是当我尝试编写一些代码时,qt找不到vtk库。 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? 我遵循了这篇文章,但某些方法无法正常工作: 在Windows上将Qt 5.4.1与vtk 6.2.0组合(使用CMake GUI 3.2.1)可以有人向我解释正确的过程吗? I'm using Windows 7 64 bit, VTK 6.2.0, QT 5.4 and CMake-GUI 3.2.2. 我正在使用Windows 7 64位,VTK 6.2.0,QT 5.4和CMake-GUI 3.2.2。 Thanks to all who respond! 感谢所有回应!

Did you build the vtk solution in debug or release? 您是否在调试或发布中构建了vtk解决方案? 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. 另外,也许是您的cMakeList问题。 Did you manage to launch the project EasyView from the vtk solution? 您是否通过vtk解决方案启动了EasyView项目?

Finally, the tutorial I followed was this one : http://www.vtk.org/Wiki/VTK/Tutorials/QtSetup 最后,我遵循的教程就是这个教程: 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. 我唯一需要修改的就是将qt版本更改为5,添加另一个条目cmake_prefix并设置几个环境变量。

Try to create Qt project with cmake instead of qmake like is described here 尝试创建与cmake的,而不是qmake的Qt工程等进行了说明这里

For a first step try to write just hello world in Qt and try to create cmake for it.. 首先,请尝试在Qt中编写问候世界,然后尝试为其创建cmake。

Then you just add the VTK find functions and use those to add vtk support to your qt cmake project. 然后,您只需添加VTK查找功能,并使用这些功能将vtk支持添加到您的qt cmake项目中。 Maybe its something like this (never used vtk): 也许是这样的(从未使用过vtk):

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

Then you should be able to use Qt and vtk in same project.. 然后,您应该可以在同一项目中使用Qt和vtk。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM