# VTK 9.0 dll missing with same setup of vtk vtk 8.x

**URL:** https://discourse.vtk.org/t/vtk-9-0-dll-missing-with-same-setup-of-vtk-vtk-8-x/4409
**Category:** Support
**Created:** [October 13, 2020, 12:39pm UTC](https://discourse.vtk.org/t/vtk-9-0-dll-missing-with-same-setup-of-vtk-vtk-8-x/4409 "2020-10-13T12:39:23Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![zandarina](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/z/4af34b/32.png) [@zandarina](https://discourse.vtk.org/u/zandarina)
#### Post date: [October 13, 2020, 12:39pm UTC](https://discourse.vtk.org/t/vtk-9-0-dll-missing-with-same-setup-of-vtk-vtk-8-x/4409/1 "2020-10-13T12:39:23Z")

</div>

Hello,

I have a doubt. With vtk 8.0, I haven’t had to add the dll in the bin directory with shared lib option ticked. With the cmake visual was able to find the dll but I found that in vtk 9.0 I am forced to put all dllls in the bin. Is there any way to set it up as before that it was directly found with visual c++ 2015? I didn’t set up the system variables in the previous versions. What change is making this behaviour. If I put all dll it works but I would like to set it as before without the dll as it is cleaner.

Thanks

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [October 13, 2020, 12:54pm UTC](https://discourse.vtk.org/t/vtk-9-0-dll-missing-with-same-setup-of-vtk-vtk-8-x/4409/2 "2020-10-13T12:54:41Z")

</div>

All `.dll` files should be in the `bin/` directory. Could you be more explicit which files you see in the expected place in 8.x? Where are the analogous files for you in 9.0?

---

<div class="post-metadata">

### Author: ![zandarina](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/z/4af34b/32.png) [@zandarina](https://discourse.vtk.org/u/zandarina)
#### Post date: [October 13, 2020, 1:09pm UTC](https://discourse.vtk.org/t/vtk-9-0-dll-missing-with-same-setup-of-vtk-vtk-8-x/4409/3 "2020-10-13T13:09:08Z")

</div>

Hello, thank you for answering I did not have to copy the dlls in the previous version I only defined this cmake and visual was able to find the dlls directly. I did not set up the environment variables eaither. I also do not define itk or qt dlls it is able to detect them. But I do not know how to do it in vtk 9.0. It 's cleaner not to copy all dlls in the release and debug folders of the the bin. Maybe because this include(${VTK\_USE\_FILE}) is not used in vtk 9.0? Thanks !!

find\_package(Qt5 COMPONENTS REQUIRED  
Concurrent Widgets)

```
# VTK
 find_package(VTK COMPONENTS REQUIRED
vtkCommonCore
vtkCommonDataModel
vtkFiltersFlowPaths
vtkGUISupportQt
vtkInteractionImage
vtkImagingStencil
vtkImagingMorphological
vtkIOGeometry
vtkIOImage
vtkIOImport
vtkIOLegacy
vtkIOXML
vtkRenderingCore   
   #${VTK_RENDERING_BACKEND}
vtkRenderingVolumeOpenGL2
vtkInteractionWidgets
   NO_MODULE)

  include(${VTK_USE_FILE})

 find_package(ITK REQUIRED)
 include(${ITK_USE_FILE})

add_library(VtkMgr STATIC
  include/VtkMgr/vtk_mgr.h src/vtk_mgr.cpp
)

target_include_directories(VtkMgr
  PUBLIC
      $<INSTALL_INTERFACE:include>
        
  $<BUILD_INTERFACE:$
 {CMAKE_CURRENT_SOURCE_DIR}/include>
  PRIVATE
    ${CMAKE_CURRENT_SOURCE_DIR}/src)

   target_link_libraries(VtkMgr
   PUBLIC
Qt5::Concurrent
    Qt5::Widgets
    ${ITK_LIBRARIES}
    ${VTK_LIBRARIES}
)

   target_compile_features(VtkMgr PUBLIC cxx_std_14)

 if(BUILD_TESTING)
 add_subdirectory(test)
 endif(BUILD_TESTING)
```

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [October 13, 2020, 2:42pm UTC](https://discourse.vtk.org/t/vtk-9-0-dll-missing-with-same-setup-of-vtk-vtk-8-x/4409/4 "2020-10-13T14:42:19Z")

</div>

I still don’t have enough information to figure out what’s wrong here. I don’t know what made it work in 8.2 or for Qt and ITK as there’s nothing special that was done before as far as I’m aware. I expect you have some `PATH` setting that made it work? What are you trying to run? A project built against VTK? VTK’s tests?

> [@zandarina](#):
>
> Maybe because this include(${VTK\_USE\_FILE}) is not used in vtk 9.0?

This has nothing to do with it. Everything that file did is now managed in `vtk_module_autoinit`.

---

<div class="post-metadata">

### Author: ![zandarina](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/z/4af34b/32.png) [@zandarina](https://discourse.vtk.org/u/zandarina)
#### Post date: [October 13, 2020, 3:07pm UTC](https://discourse.vtk.org/t/vtk-9-0-dll-missing-with-same-setup-of-vtk-vtk-8-x/4409/5 "2020-10-13T15:07:42Z")

</div>

Yes you are right. I also have this in the cmake. But in this version it does not have any effect. Thanks

```
if (WIN32)
   set_target_properties(${PROJECT_NAME} PROPERTIES
     VS_DEBUGGER_ENVIRONMENT    
  "PATH=${VTK_RUNTIME_DIRS}/$<CONFIG>;${QtBinDir}"

set(LIB_FOLDERS "${VTK_
RUNTIME_DIRS}/Release" "${Qt5_DIR}")

```

I replaced VTK\_  
RUNTIME\_DIRS by VTK\_PREFIX\_PATH. But no luck

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [October 13, 2020, 3:50pm UTC](https://discourse.vtk.org/t/vtk-9-0-dll-missing-with-same-setup-of-vtk-vtk-8-x/4409/6 "2020-10-13T15:50:14Z")

</div>

Ah, yeah, that variable isn’t provided anymore because there’s no single path for it. `${VTK_PREFIX_PATH}/bin` should work though.

---

<div class="post-metadata">

### Author: ![zandarina](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/z/4af34b/32.png) [@zandarina](https://discourse.vtk.org/u/zandarina)
#### Post date: [October 14, 2020, 7:02am UTC](https://discourse.vtk.org/t/vtk-9-0-dll-missing-with-same-setup-of-vtk-vtk-8-x/4409/7 "2020-10-14T07:02:49Z")

</div>

Hello, yes it is working now I must add the bin too !! Thank you !!
