Tracy_Nk
(Tracy )
April 1, 2020, 3:10pm
1
I’m running one of the VTK Qt examples and I’m not sure if I’m doing this correctly. I’ve configured and generated on CMake, then built on Visual Studio, then used Command Prompt to open the executable file however I get the following error:
I have Qt creator 4.11.1 (Community)
Please provide assistance
ben.boeckel
(Ben Boeckel (Kitware))
April 1, 2020, 3:36pm
2
Are the Qt DLLs in your PATH
environment variable? They need to be there for the examples to work.
1 Like
Tracy_Nk
(Tracy )
April 1, 2020, 5:30pm
3
do you mean like this on CMake?
ben.boeckel
(Ben Boeckel (Kitware))
April 1, 2020, 5:56pm
4
No, I mean in the PATH
environment variable.
1 Like
CMake only resolves paths to build your program. To run your program, the OS needs to know where to find DLLs. So, you either:
Do like @ben.boeckel said;
Copy all the required DLLs to a deploy directory along the excutable and run it there;
Create a launcher .BAT like this if you don’t want (or can’t) change your OS environment or don’t want to keep a deploy directory:
setlocal
set PATH=C:\<Qt´s install path>\5.13\msvc2015_64\bin;%PATH%
myCoolQtProgram.exe
The setlocal
ensures the PATH setting is only valid when the program runs and does not change your environment permanently.
The same rationale applies to other libraries that your program may be linked to (like VTK itself).
1 Like
xuexl
(xxl)
April 2, 2020, 1:21am
6
Hi, I am using “qt+cmake+vtk” for developing now, Normally, I down examples from vtk’s web, then build them in the qt with cmake. if you want to publish them into other computers or to excute them in the system, you can use “windeployqt.exe” in win10 system, it will create the package for excuting with dll files of qt, and in sure that the vtk package path is in the evironment of system.
Here’s the DLLs I have to distribute with my application. Yours will likely to be different, since you’re building with Visual Studio and you use only Qt and VTK. This list shows that, in addition to Qt and VTK, you have to distribute the Visual Studio runtime and other possible libraries you may use in the future as well.
libbz2-1.dll*
libfftw3-3.dll*
libfreetype-6.dll*
libgcc_s_seh-1.dll*
libglib-2.0-0.dll*
libgraphite2.dll*
libgsl-23.dll*
libgslcblas-0.dll*
libharfbuzz-0.dll*
libiconv-2.dll*
libicudt58.dll*
libicuin58.dll*
libicuuc58.dll*
libintl-8.dll*
libITKCommon-4.11.dll*
libitkdouble-conversion-4.11.dll*
libitksys-4.11.dll*
libITKTransform-4.11.dll*
libitkv3p_netlib-4.11.dll*
libitkvcl-4.11.dll*
libitkvnl_algo-4.11.dll*
libitkvnl-4.11.dll*
libITKVNLInstantiation-4.11.dll*
libpcre-1.dll*
libpng16-16.dll*
libstdc++-6.dll*
libvtkalglib-8.1.dll*
libvtkCommonColor-8.1.dll*
libvtkCommonComputationalGeometry-8.1.dll*
libvtkCommonCore-8.1.dll*
libvtkCommonDataModel-8.1.dll*
libvtkCommonExecutionModel-8.1.dll*
libvtkCommonMath-8.1.dll*
libvtkCommonMisc-8.1.dll*
libvtkCommonSystem-8.1.dll*
libvtkCommonTransforms-8.1.dll*
libvtkFiltersCore-8.1.dll*
libvtkFiltersExtraction-8.1.dll*
libvtkFiltersGeneral-8.1.dll*
libvtkFiltersGeometry-8.1.dll*
libvtkFiltersHybrid-8.1.dll*
libvtkFiltersModeling-8.1.dll*
libvtkFiltersSources-8.1.dll*
libvtkFiltersStatistics-8.1.dll*
libvtkfreetype-8.1.dll*
libvtkglew-8.1.dll*
libvtkGUISupportQt-8.1.dll*
libvtkImagingCore-8.1.dll*
libvtkImagingFourier-8.1.dll*
libvtkImagingGeneral-8.1.dll*
libvtkImagingHybrid-8.1.dll*
libvtkImagingSources-8.1.dll*
libvtkImagingStencil-8.1.dll*
libvtkInteractionStyle-8.1.dll*
libvtkInteractionWidgets-8.1.dll*
libvtkRenderingAnnotation-8.1.dll*
libvtkRenderingContext2D-8.1.dll*
libvtkRenderingCore-8.1.dll*
libvtkRenderingFreeType-8.1.dll*
libvtkRenderingOpenGL2-8.1.dll*
libvtkRenderingVolume-8.1.dll*
libvtksys-8.1.dll*
libvtkzlib-8.1.dll*
libwinpthread-1.dll*
Qt5Charts.dll*
Qt5Core.dll*
Qt5Gui.dll*
Qt5OpenGL.dll*
Qt5PrintSupport.dll*
Qt5Svg.dll*
Qt5Widgets.dll*
qwt.dll*
zlib1.dll*