# Building VTK for Qt fails due to makefile error

**URL:** https://discourse.vtk.org/t/building-vtk-for-qt-fails-due-to-makefile-error/11394
**Category:** Support
**Created:** [May 6, 2023, 11:57am UTC](https://discourse.vtk.org/t/building-vtk-for-qt-fails-due-to-makefile-error/11394 "2023-05-06T11:57:12Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Z.O.E](https://discourse.vtk.org/user_avatar/discourse.vtk.org/z.o.e/32/7045_2.png) [@Z.O.E](https://discourse.vtk.org/u/Z.O.E)
#### Post date: [May 6, 2023, 11:57am UTC](https://discourse.vtk.org/t/building-vtk-for-qt-fails-due-to-makefile-error/11394/1 "2023-05-06T11:57:12Z")

</div>

Hello,  
I wanted to use QVTKOpenGLWidget in my Qt application. But I am unable to build VTK for Qt in the first place.  
I am on Ubuntu 22.04, Qt version installed is 5.15.3, cmake is 3.22.1. I downloaded VTK-8.2.0 and its path is `/home/developer/VTK-8.2.0`.

- I made a directory in it called `build`
- Ran `cmake-gui ..`
- These were some of my flags after I had configured for `Unix makefiles`:

```auto
* VTK_Group_Qt ON
* VTK_Group_Rendering ON
* VTK_Group_StandAlone ON
* VTK_PYTHON_VERSION 2
* VTK_QT_VERSION 5
* QT5_DIR /usr/lib/x86_64-linux-gnu/cmake/Qt5
* VTK_RENDERING_BACKEND OpenGL2
* BUILD_SHARED_LIBS ON
* CMAKE_BUILD_TYPE Release
* CMAKE_INSTALL_PREFIX /usr/local

```

- I generated the `Makefile` from the `cmake-gui`
- In the `build` directory I ran `make -j8`
- It runs till 38% or 46% or 51% and gives error `make: *** [Makefile 136: all] Error 2`

I have also tried `VTK_PYTHON_VERSION 3.6` with same result.

What am I doing wrong? If someone could be kind enough to help me

---

<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: [May 9, 2023, 9:55am UTC](https://discourse.vtk.org/t/building-vtk-for-qt-fails-due-to-makefile-error/11394/2 "2023-05-09T09:55:15Z")

</div>

> [@Z.O.E](#):
>
> - `make: *** [Makefile 136: all] Error 2`

There is other error on top of that, please share them

> VTK-8.2.0.

That is old
