# VTK 9.2.6 missing dll

**URL:** https://discourse.vtk.org/t/vtk-9-2-6-missing-dll/10965
**Category:** Support
**Tags:** code
**Created:** [March 14, 2023, 12:51pm UTC](https://discourse.vtk.org/t/vtk-9-2-6-missing-dll/10965 "2023-03-14T12:51:21Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![antoine1](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/a/73ab20/32.png) [@antoine1](https://discourse.vtk.org/u/antoine1)
#### Post date: [March 14, 2023, 12:51pm UTC](https://discourse.vtk.org/t/vtk-9-2-6-missing-dll/10965/1 "2023-03-14T12:51:21Z")

</div>

Hello everyone,

I’m new in vtk and i try to add it to my cmake for a new project with QT.  
I had vtk to my cmake like this:

```auto

set(VTK_DIR "C:/vtk/VTK-9.2.6-install/lib/cmake/vtk-9.2/") 
find_package(VTK REQUIRED)
target_link_libraries( AstroBase PRIVATE ${VTK_LIBRARIES})

```

When i try to launch a test, a message box open to inform me that some .dll are missing.

I have set ass system variables path %VTK\_DIR%/bin. (I work on windows with visual studio community) but it look like cmake do not go to search into this path variable.

I tried to message($env{PATH}) to see what path contains and i found that the path variable return from cmake is totally difference from the one that i setup in my environnement variables from windows. It’s look like more link to visual studio than windows. (Yes I’m also beginner with cmake.)

As i don’t want to copy all the bin directory to my project i would like to setup properly my cmake to go to search into the good directory.

do you know how can i solve it?

thank you in advance!

---

<div class="post-metadata">

### Author: ![Aron\_Helser](https://discourse.vtk.org/user_avatar/discourse.vtk.org/aron_helser/32/14_2.png) [@Aron\_Helser](https://discourse.vtk.org/u/Aron_Helser)
#### Post date: [March 14, 2023, 1:33pm UTC](https://discourse.vtk.org/t/vtk-9-2-6-missing-dll/10965/2 "2023-03-14T13:33:13Z")

</div>

The `VTK_DIR` value you have set points to the files cmake needs inside the VTK install, but not the DLLs. Looks like they will be in “C:/vtk/VTK-9.2.6-install/bin” - try adding that to your path.

Also, how are you launching a test? That may affect how env-vars like PATH are set.  
HTH,  
Aron

---

<div class="post-metadata">

### Author: ![antoine1](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/a/73ab20/32.png) [@antoine1](https://discourse.vtk.org/u/antoine1)
#### Post date: [March 14, 2023, 1:43pm UTC](https://discourse.vtk.org/t/vtk-9-2-6-missing-dll/10965/3 "2023-03-14T13:43:45Z")

</div>

Thank you for your reply.

Yes sorry i didn’t mention but in my cmake VTK\_DIR point to cmake config files but in my windows environnement variable VTK\_DIR point to C:/vtk/VTK-9.2.6-install/.

So in path when i set up %VTK\_DIR%/bin the valeur should be C:/vtk/VTK-9.2.6-install/bin.

I launch my test via visual studio. I just select the executable file main and launch it.

How can i specify to cmake to check the system environnement variables and not the one from visual studio?

---

<div class="post-metadata">

### Author: ![Aron\_Helser](https://discourse.vtk.org/user_avatar/discourse.vtk.org/aron_helser/32/14_2.png) [@Aron\_Helser](https://discourse.vtk.org/u/Aron_Helser)
#### Post date: [March 14, 2023, 1:59pm UTC](https://discourse.vtk.org/t/vtk-9-2-6-missing-dll/10965/4 "2023-03-14T13:59:08Z")

</div>

I don’t think cmake is involved - it’s just building your app, and that’s been done already.  
If you launch the test inside VS, then VS is controlling the environment. I think you want to look at the Debug menu, and the config Debug Properties item at the bottom - the VC++ Directories … Executable Directories entry gives you control of the PATH.

---

<div class="post-metadata">

### Author: ![antoine1](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/a/73ab20/32.png) [@antoine1](https://discourse.vtk.org/u/antoine1)
#### Post date: [March 14, 2023, 4:28pm UTC](https://discourse.vtk.org/t/vtk-9-2-6-missing-dll/10965/5 "2023-03-14T16:28:27Z")

</div>

Ok so i tried what you said but i didn’t had the VC++ directories.  
But i finally found the solution.

With visual studio and cmake, the environnement is manage by the file CMakeSettings.json.

In this file, i just add at the top of the json as global declaration (before configuration):

```auto

  "environments": [
    {
      "PATH": "${env.PATH};C:\\vtk\\VTK-9.2.6-install\\bin"
    }
  ]

```

and that work.

Thank you for your help
