# How can I fix a build error?

**URL:** https://discourse.vtk.org/t/how-can-i-fix-a-build-error/4690
**Category:** Support
**Created:** [November 20, 2020, 6:54am UTC](https://discourse.vtk.org/t/how-can-i-fix-a-build-error/4690 "2020-11-20T06:54:40Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![nia38](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/n/7ba0ec/32.png) [@nia38](https://discourse.vtk.org/u/nia38)
#### Post date: [November 20, 2020, 6:54am UTC](https://discourse.vtk.org/t/how-can-i-fix-a-build-error/4690/1 "2020-11-20T06:54:40Z")

</div>

VS2019 is in use, and you are trying to build VTK-9.0.1 with Cmake.

The following error occurs when Cmake is run:

How should I handle this?

 ![screenshot](https://discourse.vtk.org/uploads/default/original/2X/9/981f16e4b8d8d46c68d34cd3cd3e15462b472c5b.jpeg)

---

<div class="post-metadata">

### Author: ![SArbabi](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/b5ac83/32.png) [@SArbabi](https://discourse.vtk.org/u/SArbabi)
#### Post date: [November 20, 2020, 8:57am UTC](https://discourse.vtk.org/t/how-can-i-fix-a-build-error/4690/2 "2020-11-20T08:57:14Z")

</div>

Hi, this worked for me:

> [@9.0.0.rc1 ContextOpenGL2 not built](https://discourse.vtk.org/t/9-0-0-rc1-contextopengl2-not-built/2933/11):
>
> Hm okay. I just tested with curl -LO https://www.vtk.org/files/release/9.0/VTK-9.0.1.tar.gz tar xf VTK-9.0.1.tar.gz cd VTK-9.0.1/ mkdir build cd build cmake -DVTK\_MODULE\_ENABLE\_VTK\_RenderingContextOpenGL2=YES .. and I’m not getting that warning here. Full transcript here: [transcript.txt](https://discourse.vtk.org/uploads/short-url/7syuxChBKqrsfYMwACk7RXpWS7l.txt) (30.0 KB) Maybe it has something to with what groups/modules get enabled by default on your system. Would help to see the output from the CMake run.

---

<div class="post-metadata">

### Author: ![nia38](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/n/7ba0ec/32.png) [@nia38](https://discourse.vtk.org/u/nia38)
#### Post date: [November 23, 2020, 2:23am UTC](https://discourse.vtk.org/t/how-can-i-fix-a-build-error/4690/3 "2020-11-23T02:23:41Z")

</div>

Thank you. Saeed.

I read a your transcript.txt.  
but i don’t know this problem.

when i input the command( cmake -DVTK\_MODULE\_ENABLE\_VTK\_RenderingContextOpenGL2=YES …) , I received the message (this message is below that)

CMake Error: The source directory “D:/VTK/VTK-9.0.1” does not appear to contain CMakeLists.txt.  
Specify --help for usage, or press the help button on the CMake GUI.

How to solve the this problem??

---

<div class="post-metadata">

### Author: ![SArbabi](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/b5ac83/32.png) [@SArbabi](https://discourse.vtk.org/u/SArbabi)
#### Post date: [November 23, 2020, 9:03am UTC](https://discourse.vtk.org/t/how-can-i-fix-a-build-error/4690/4 "2020-11-23T09:03:33Z")

</div>

check why CMakeLists.txt doesn’t exist in folder D:/VTK/VTK-9.0.1

---

<div class="post-metadata">

### Author: ![nia38](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/n/7ba0ec/32.png) [@nia38](https://discourse.vtk.org/u/nia38)
#### Post date: [November 24, 2020, 12:37am UTC](https://discourse.vtk.org/t/how-can-i-fix-a-build-error/4690/5 "2020-11-24T00:37:09Z")

</div>

Thank you, Saeed.

I checked the path and then trying the your’s command.  
but i still have a problem.

this is my error and output log… [CMakeError.log](https://discourse.vtk.org/uploads/short-url/uKqqkRABty2cK5VRXVVZzsAtJUU.log) (29.7 KB) [CMakeOutput.log](https://discourse.vtk.org/uploads/short-url/c4DMzmKIKlPVTFP4CPm7obhwEQJ.log) (26.5 KB)

Thank you for taking the time to help me.

---

<div class="post-metadata">

### Author: ![Joachim\_P](https://discourse.vtk.org/user_avatar/discourse.vtk.org/joachim_p/32/3272_2.png) [@Joachim\_P](https://discourse.vtk.org/u/Joachim_P)
#### Post date: [November 25, 2020, 10:14pm UTC](https://discourse.vtk.org/t/how-can-i-fix-a-build-error/4690/6 "2020-11-25T22:14:08Z")

</div>

Looking at your first screenshot, I am surprised that CMake seems to find `pthread.h` while you are targetting a Windows build with VS2019 (pthread is a POSIX API for threads that is not natively supported by Microsoft). Is it expected? You might want to find this header and make sure CMake can’t find it and guess you are using a POSIX environment.
