# CMake Error with VTK: "VTK::CommonColor" includes non-existent path

**URL:** <https://discourse.vtk.org/t/cmake-error-with-vtk-vtk-commoncolor-includes-non-existent-path/15179>\
**Category:** Development\
**Created:** [January 20, 2025, 7:10am UTC](https://discourse.vtk.org/t/cmake-error-with-vtk-vtk-commoncolor-includes-non-existent-path/15179 "2025-01-20T07:10:09Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![manafpv](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/m/ee7513/32.png) [@manafpv](https://discourse.vtk.org/u/manafpv)\
**Post date:** [January 20, 2025, 7:10am UTC](https://discourse.vtk.org/t/cmake-error-with-vtk-vtk-commoncolor-includes-non-existent-path/15179/1 "2025-01-20T07:10:09Z")

</div>

Hello,

I am encountering the following error when trying to configure a project with CMake using the example code from [VTK Cylinder Example](https://examples.vtk.org/site/Cxx/GeometricObjects/CylinderExample/):

```auto
paar-orin1@ubuntu:~/overlay_cpp/deepstream_app/CylinderExample/build$ cmake ..
-- Configuring done
CMake Error in CMakeLists.txt:
  Imported target "VTK::CommonColor" includes non-existent path

    "/usr/local/include/vtk-9.4"

  in its INTERFACE_INCLUDE_DIRECTORIES. Possible reasons include:

  * The path was deleted, renamed, or moved to another location.
  * An install or uninstall procedure did not complete successfully.
  * The installation package was faulty and references files it does not provide.

-- Generating done
CMake Generate step failed. Build files cannot be regenerated correctly.

```

I have installed VTK 9.1 using the package manager on my system:

```auto
paar-orin1@ubuntu:~/overlay_cpp/deepstream_app/CylinderExample/build$ dpkg-query -l | grep vtk
ii libvtk9.1:arm64 9.1.0+really9.1.0+dfsg2-3build1 arm64 VTK libraries

```

However, CMake is looking for VTK version 9.4 headers in the path `/usr/local/include/vtk-9.4`, which doesn’t exist on my system. I’ve confirmed that I have VTK 9.1 installed and I haven’t installed version 9.4 manually.

Could anyone guide me on how to resolve this issue? It seems like CMake is incorrectly pointing to a non-existent version of VTK, or possibly there is a misconfiguration related to the version.

Any help would be greatly appreciated!

---

<div class="post-metadata">

**Author:** ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)\
**Post date:** [January 20, 2025, 9:52am UTC](https://discourse.vtk.org/t/cmake-error-with-vtk-vtk-commoncolor-includes-non-existent-path/15179/2 "2025-01-20T09:52:48Z")

</div>

> [@manafpv](#):
>
> `Imported target "VTK::CommonColor" includes non-existent path`

Are you sure you do not have another VTK somewhere on your machine ?

---

<div class="post-metadata">

**Author:** ![manafpv](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/m/ee7513/32.png) [@manafpv](https://discourse.vtk.org/u/manafpv)\
**Post date:** [January 20, 2025, 10:15am UTC](https://discourse.vtk.org/t/cmake-error-with-vtk-vtk-commoncolor-includes-non-existent-path/15179/3 "2025-01-20T10:15:57Z")

</div>

These are the all installed VTK-related packages on my system

paar-orin1@ubuntu:~/DiffuseSpheres/test$ dpkg -l | grep vtk  
ii libvtk9-dev 9.1.0+really9.1.0+dfsg2-3build1 arm64 VTK header files  
ii libvtk9-java 9.1.0+really9.1.0+dfsg2-3build1 arm64 VTK - Java language support  
ii libvtk9.1:arm64 9.1.0+really9.1.0+dfsg2-3build1 arm64 VTK libraries  
ii libvtk9.1-qt:arm64 9.1.0+really9.1.0+dfsg2-3build1 arm64 VTK libraries, Qt files  
ii python3-vtk9 9.1.0+really9.1.0+dfsg2-3build1 arm64 Python bindings for VTK  
ii vtk9 9.1.0+really9.1.0+dfsg2-3build1 arm64 Binaries for VTK9

"I installed the Python version of VTK using the following method:

```bash
python3 -m pip install "https://github.com/finsberg/vtk-aarch64/releases/download/vtk-9.2.6-cp310/vtk-9.2.6.dev0-cp310-cp310-linux_aarch64.whl"

```

This command downloads and installs a prebuilt wheel package for VTK version 9.2.6, specifically for Python 3.10 on the aarch64 architecture."

---

<div class="post-metadata">

**Author:** ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)\
**Post date:** [January 20, 2025, 12:20pm UTC](https://discourse.vtk.org/t/cmake-error-with-vtk-vtk-commoncolor-includes-non-existent-path/15179/4 "2025-01-20T12:20:42Z")

</div>

Can you try pointing the VTK\_DIR to the right directory manually in your cmake command ?

---

<div class="post-metadata">

**Author:** ![manafpv](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/m/ee7513/32.png) [@manafpv](https://discourse.vtk.org/u/manafpv)\
**Post date:** [January 20, 2025, 12:25pm UTC](https://discourse.vtk.org/t/cmake-error-with-vtk-vtk-commoncolor-includes-non-existent-path/15179/5 "2025-01-20T12:25:57Z")

</div>

I am sorry I didnt understand , can you explain in clear way

---

<div class="post-metadata">

**Author:** ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)\
**Post date:** [January 20, 2025, 12:27pm UTC](https://discourse.vtk.org/t/cmake-error-with-vtk-vtk-commoncolor-includes-non-existent-path/15179/6 "2025-01-20T12:27:46Z")

</div>

You are using the cmake command:

` cmake ..`

Instead use:

`cmake -DVTK_DIR=/usr/local/include/vtk-9.1 ..`

Adapt the path to the directory containing `vtk-config.cmake`.

---

<div class="post-metadata">

**Author:** ![manafpv](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/m/ee7513/32.png) [@manafpv](https://discourse.vtk.org/u/manafpv)\
**Post date:** [January 20, 2025, 12:45pm UTC](https://discourse.vtk.org/t/cmake-error-with-vtk-vtk-commoncolor-includes-non-existent-path/15179/7 "2025-01-20T12:45:04Z")

</div>

I corrected the installation by using this command

```
cmake -DVTK_DIR=/usr/lib/cmake/vtk-9.1 ..

make

```

When I run the code

```
./CylinderExample

```

i got this as error :

```
paar-orin1@ubuntu:~/overlay_cpp/deepstream_app/CylinderExample/build$ ./CylinderExample
Segmentation fault (core dumped)

```

---

<div class="post-metadata">

**Author:** ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)\
**Post date:** [January 20, 2025, 12:45pm UTC](https://discourse.vtk.org/t/cmake-error-with-vtk-vtk-commoncolor-includes-non-existent-path/15179/8 "2025-01-20T12:45:52Z")

</div>

Build in debug and use gdb

---

<div class="post-metadata">

**Author:** ![manafpv](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/m/ee7513/32.png) [@manafpv](https://discourse.vtk.org/u/manafpv)\
**Post date:** [January 20, 2025, 12:56pm UTC](https://discourse.vtk.org/t/cmake-error-with-vtk-vtk-commoncolor-includes-non-existent-path/15179/9 "2025-01-20T12:56:43Z")

</div>

Thank you for your previous assistance; my program is now working successfully. I am currently developing an application that integrates VTK, OpenCV, and DeepStream, and I need help creating a proper Makefile to ensure these libraries are correctly configured and accessible.

I encountered an issue related to rendering the window output when running my code and raised it on the VTK forum. For reference, here is the link to the issue I posted:

> [@i didnt get the rendering window output when I run my code](https://discourse.vtk.org/t/i-didnt-get-the-rendering-window-output-when-i-run-my-code/15180):
>
> When I use this code ,i am getting output like this i cant see renderd output window , what is the reason #include \<vtk-9.1/vtkVersion.h\> #include \<vtk-9.1/vtkActor.h\> #include \<vtk-9.1/vtkDiskSource.h\> #include \<vtk-9.1/vtkPolyDataMapper.h\> #include \<vtk-9.1/vtkRenderer.h\> #include \<vtk-9.1/vtkRenderWindow.h\> #include \<vtk-9.1/vtkRenderWindowInteractor.h\> #include \<vtk-9.1/vtkSmartPointer.h\> #include \<vtk-9.1/vtkNamedColors.h\> #include \<iostream\> int m…

Could you please guide me in resolving this issue and in writing a proper Makefile for my application?
