# "Could not find the VTK package with the following required components: RenderingContextOpenGL2."

**URL:** https://discourse.vtk.org/t/could-not-find-the-vtk-package-with-the-following-required-components-renderingcontextopengl2/3778
**Category:** Support
**Created:** [July 15, 2020, 1:16pm UTC](https://discourse.vtk.org/t/could-not-find-the-vtk-package-with-the-following-required-components-renderingcontextopengl2/3778 "2020-07-15T13:16:20Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![JenJen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jenjen/32/1211_2.png) [@JenJen](https://discourse.vtk.org/u/JenJen)
#### Post date: [July 15, 2020, 1:16pm UTC](https://discourse.vtk.org/t/could-not-find-the-vtk-package-with-the-following-required-components-renderingcontextopengl2/3778/1 "2020-07-15T13:16:20Z")

</div>

I am trying to run one of the examples “Glyph3DImage”, and also use vtkGlyph3DMapper in some other code. I am using the latest CMake and VTK9.0.0. The error “Could not find the VTK package with the following required components: RenderingContextOpenGL2.” occurs when I run CMake. It looks like this is to do with the way VTK9.0.0 deals with modules, but I am unsure how to solve the problem. Do I need to make changes to my VTK installation, or do I need to edit the files for the individual example, and if so, how?

Many thanks. Apologies, I think this question has been answered before, but I am unable to follow the answers to fix the problem.

---

<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: [July 15, 2020, 4:16pm UTC](https://discourse.vtk.org/t/could-not-find-the-vtk-package-with-the-following-required-components-renderingcontextopengl2/3778/2 "2020-07-15T16:16:37Z")

</div>

There should be a `VTK_NOT_FOUND_MESSAGE` variable which contains the reasoning. CMake should show it automatically if you used `REQUIRED`. Possible causes:

- your VTK build does not have that module available (most likely)
- some other module it needs could not find a dependency (possible)
- OpenGL was not found (unlikely)

---

<div class="post-metadata">

### Author: ![JenJen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jenjen/32/1211_2.png) [@JenJen](https://discourse.vtk.org/u/JenJen)
#### Post date: [July 15, 2020, 6:15pm UTC](https://discourse.vtk.org/t/could-not-find-the-vtk-package-with-the-following-required-components-renderingcontextopengl2/3778/3 "2020-07-15T18:15:29Z")

</div>

Thanks. I’m using CMake with the GUI in Windows 10. I guess there is some setting that sets REQUIRED, but it’s not jumping out at me! Sorry, I’m new to CMake and VTK.

---

<div class="post-metadata">

### Author: ![JenJen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jenjen/32/1211_2.png) [@JenJen](https://discourse.vtk.org/u/JenJen)
#### Post date: [July 22, 2020, 12:44pm UTC](https://discourse.vtk.org/t/could-not-find-the-vtk-package-with-the-following-required-components-renderingcontextopengl2/3778/4 "2020-07-22T12:44:05Z")

</div>

Dear Ben, I added and entry in CMake using VTK\_MODULE\_ENABLE\_VTK\_RenderingContextOpenGL2 and setting its value to YES. This now seems to mean that the examples can be created in CMake and compiled in Visual Studio but now I have a problem that I was experiencing with an older version of VTK - I run the executable and although it appears to have run (no errors), no visualization window appears (nothing happens). Do you have any ideas? All my problems seem related to OpenGL in some way? Many thanks,  
Jen

---

<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: [July 22, 2020, 3:16pm UTC](https://discourse.vtk.org/t/could-not-find-the-vtk-package-with-the-following-required-components-renderingcontextopengl2/3778/5 "2020-07-22T15:16:33Z")

</div>

You shouldn’t need to _add_ such an entry. It might be advanced, but it should be offered automatically.

As for the window, showing the code that is executing would be useful. I suspect the window is made, but never shown and the program exits without waiting for an interaction loop to happen. Cc: @ken-martin

---

<div class="post-metadata">

### Author: ![JenJen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jenjen/32/1211_2.png) [@JenJen](https://discourse.vtk.org/u/JenJen)
#### Post date: [July 22, 2020, 3:25pm UTC](https://discourse.vtk.org/t/could-not-find-the-vtk-package-with-the-following-required-components-renderingcontextopengl2/3778/6 "2020-07-22T15:25:47Z")

</div>

Yes, it all seems a little odd, especially as I’m using the most up to date versions of everything. The render window was showing for the Sphere example before I “added” RenderingContextOpenGL2, but then the Glyph3D example wouldn’t compile. It feels like something needs updating in the example code so that I am pointing to the right place, rather than making the change to the installation? Either that, or there is some kind of issue with the OpenGL on my laptop? I did also send an e-mail to the address given on the example page but unfortunately haven’t had any response.
