# Can't build VTK sample project: Missing module

**URL:** https://discourse.vtk.org/t/cant-build-vtk-sample-project-missing-module/8056
**Category:** Support
**Created:** [March 15, 2022, 11:55am UTC](https://discourse.vtk.org/t/cant-build-vtk-sample-project-missing-module/8056 "2022-03-15T11:55:19Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Ilmu011](https://discourse.vtk.org/user_avatar/discourse.vtk.org/ilmu011/32/4237_2.png) [@Ilmu011](https://discourse.vtk.org/u/Ilmu011)
#### Post date: [March 15, 2022, 11:55am UTC](https://discourse.vtk.org/t/cant-build-vtk-sample-project-missing-module/8056/1 "2022-03-15T11:55:19Z")

</div>

I am trying to build the CylinderExample with VTK. I am on ubuntu 20.04 LTS and installed VTK with vcpkg. The project is built with CMake.

However, the CMake initialization command fails:

```auto
Skipping CylinderExample: Could not find the VTK package with the following required components: RenderingContextOpenGL2.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ilmu011/Desktop/CylinderExample/build

```

Here is my CMakeLists.txt. I had to edit it slightly from the given one on the website since I built it with vcpkg

```auto
cmake_minimum_required(VERSION 3.12 FATAL_ERROR)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(CMAKE_TOOLCHAIN_FILE /home/ilmu011/Desktop/vcpkg/scripts/buildsystems/vcpkg.cmake CACHE STRING "")
set(VCPKG_TARGET_TRIPLET "x64-linux" CHACHE STRING)

set(CMAKE_PREFIX_PATH
/home/ilmu011/Desktop/vcpkg/installed/x64-linux/share/vtk
)

project(CylinderExample, LANGUAGES CXX)

find_package(VTK COMPONENTS 
  vtkCommonColor
  vtkCommonCore
  vtkFiltersSources
  vtkInteractionStyle
  vtkRenderingContextOpenGL2
  vtkRenderingCore
  vtkRenderingFreeType
  vtkRenderingGL2PSOpenGL2
  vtkRenderingOpenGL2
  QUIET
)

if (NOT VTK_FOUND)
  message("Skipping CylinderExample: ${VTK_NOT_FOUND_MESSAGE}")
  return()
endif()
message (STATUS "VTK_VERSION: ${VTK_VERSION}")
if (VTK_VERSION VERSION_LESS "8.90.0")
  # old system
  include(${VTK_USE_FILE})
  add_executable(CylinderExample MACOSX_BUNDLE CylinderExample.cxx )
  target_link_libraries(CylinderExample PRIVATE ${VTK_LIBRARIES})
else()
  # Prevent a "command line is too long" failure in Windows.
  set(CMAKE_NINJA_FORCE_RESPONSE_FILE "ON" CACHE BOOL "Force Ninja to use response files.")
  add_executable(CylinderExample MACOSX_BUNDLE CylinderExample.cxx )
  target_link_libraries(CylinderExample PRIVATE ${VTK_LIBRARIES})
  # vtk_module_autoinit is needed
  vtk_module_autoinit(
    TARGETS CylinderExample
    MODULES ${VTK_LIBRARIES}
    )
endif()

```

The source code is exactly like the code given on the website: [https://kitware.github.io/vtk-examples/site/Cxx/GeometricObjects/CylinderExample/](https://kitware.github.io/vtk-examples/site/Cxx/GeometricObjects/CylinderExample/)

How can I fix this?

---

<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: [March 15, 2022, 12:09pm UTC](https://discourse.vtk.org/t/cant-build-vtk-sample-project-missing-module/8056/2 "2022-03-15T12:09:10Z")

</div>

Make sure vtk is build with

```auto
RenderingContextOpenGL2

```

---

<div class="post-metadata">

### Author: ![Ilmu011](https://discourse.vtk.org/user_avatar/discourse.vtk.org/ilmu011/32/4237_2.png) [@Ilmu011](https://discourse.vtk.org/u/Ilmu011)
#### Post date: [March 15, 2022, 12:10pm UTC](https://discourse.vtk.org/t/cant-build-vtk-sample-project-missing-module/8056/3 "2022-03-15T12:10:28Z")

</div>

Do you mean I should replace `vtkRenderingContextOpenGL2` with `RenderingContextOpenGL2` or add it to the bottom?

---

<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: [March 15, 2022, 12:13pm UTC](https://discourse.vtk.org/t/cant-build-vtk-sample-project-missing-module/8056/4 "2022-03-15T12:13:06Z")

</div>

No I mean that your VTK is missing some required modules.

---

<div class="post-metadata">

### Author: ![Ilmu011](https://discourse.vtk.org/user_avatar/discourse.vtk.org/ilmu011/32/4237_2.png) [@Ilmu011](https://discourse.vtk.org/u/Ilmu011)
#### Post date: [March 15, 2022, 12:15pm UTC](https://discourse.vtk.org/t/cant-build-vtk-sample-project-missing-module/8056/5 "2022-03-15T12:15:06Z")

</div>

I installed vtk via vcpkg. How do you suggest I could acquire the missing modules? vcpkg says the vtk version is 9.0.3

I am not super familiar with how the VTK build process works

---

<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: [March 15, 2022, 12:23pm UTC](https://discourse.vtk.org/t/cant-build-vtk-sample-project-missing-module/8056/6 "2022-03-15T12:23:49Z")

</div>

I do not know vcpkg, but VTK can be built easily from source:

[https://gitlab.kitware.com/vtk/vtk/-/blob/master/Documentation/dev/build.md](https://gitlab.kitware.com/vtk/vtk/-/blob/master/Documentation/dev/build.md)

That being said, this is strange that vcpkg do not have this VTK modules, so you may want to open an issue in vcpkf.

---

<div class="post-metadata">

### Author: ![Ilmu011](https://discourse.vtk.org/user_avatar/discourse.vtk.org/ilmu011/32/4237_2.png) [@Ilmu011](https://discourse.vtk.org/u/Ilmu011)
#### Post date: [March 15, 2022, 1:12pm UTC](https://discourse.vtk.org/t/cant-build-vtk-sample-project-missing-module/8056/7 "2022-03-15T13:12:03Z")

</div>

I just built vtk from source as the document describes, but it still doesn’t work. It’s weird. The cmake command works as it should:

```auto
ilmu011@ilmu011-VirtualBox:~/Desktop/CylinderExample$ cmake -S source -B build
-- The C compiler identification is GNU 9.4.0
-- The CXX compiler identification is GNU 9.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Skipping CylinderExample: 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ilmu011/Desktop/CylinderExample/build

```

However, when I run make, nothing happens. No text output, nothing and no executable is made.

I used the exact source file and cmake file, the only thing I changed in the CMakeLists.txt is add the line

```auto
set(CMAKE_PREFIX_PATH
~/Desktop/vtk
)

```

in the 2nd line to provide the vtk directory in the cmake file so I don’t have to do it in the command.

What’s going on?

---

<div class="post-metadata">

### Author: ![dgobbi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dgobbi/32/18_2.png) [@dgobbi](https://discourse.vtk.org/u/dgobbi)
#### Post date: [March 15, 2022, 2:18pm UTC](https://discourse.vtk.org/t/cant-build-vtk-sample-project-missing-module/8056/8 "2022-03-15T14:18:18Z")

</div>

@limu011 Which version or VTK are you using? VTK 9.0 or VTK 9.1?

Please try removing `vtkRenderingContextOpenGL2` and `vtkRenderingGL2PSOpenGL2` from `COMPONENTS`, your project probably doesn’t need them:

```auto
find_package(VTK COMPONENTS 
  vtkCommonColor
  vtkCommonCore
  vtkFiltersSources
  vtkInteractionStyle
  vtkRenderingCore
  vtkRenderingFreeType
  vtkRenderingOpenGL2
  QUIET
)

```

@mwestfal This might be related to a bug in the VTK 9.0 configuration, where vtkRenderingContextOpenGL2 was accidentally left out of the default build. See [!7646](https://gitlab.kitware.com/vtk/vtk/-/merge_requests/7646) for more information.

---

<div class="post-metadata">

### Author: ![dgobbi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dgobbi/32/18_2.png) [@dgobbi](https://discourse.vtk.org/u/dgobbi)
#### Post date: [March 15, 2022, 2:22pm UTC](https://discourse.vtk.org/t/cant-build-vtk-sample-project-missing-module/8056/9 "2022-03-15T14:22:19Z")

</div>

Also see related discussion here:

> [@9.0.0.rc1 ContextOpenGL2 not built](https://discourse.vtk.org/t/9-0-0-rc1-contextopengl2-not-built/2933):
>
> I’ve built 9.0rc1 and use 9.0rc1 to reconfigure my project. But it exists an error: “Could not find the VTK package with the following required components: RenderingContextOpenGL2.” I find that there is no cmake files in ContextOpenGL2 folder

---

<div class="post-metadata">

### Author: ![Ilmu011](https://discourse.vtk.org/user_avatar/discourse.vtk.org/ilmu011/32/4237_2.png) [@Ilmu011](https://discourse.vtk.org/u/Ilmu011)
#### Post date: [March 15, 2022, 2:45pm UTC](https://discourse.vtk.org/t/cant-build-vtk-sample-project-missing-module/8056/10 "2022-03-15T14:45:18Z")

</div>

When I tried your suggestion of deleting the lines using the vcpkg installation (9.0.3), the previous error about not finding the package disappeared. However, trying to build the program with make generates this:

```auto
ilmu011@ilmu011-VirtualBox:~/Desktop/CylinderExample/build$ make
[50%] Building CXX object CMakeFiles/CylinderExample.dir/CylinderExample.cxx.o
[100%] Linking CXX executable CylinderExample
/usr/bin/ld: /home/ilmu011/Desktop/vcpkg/installed/x64-linux/lib/libfreetype.a(sfnt.c.o): in function `Load_SBit_Png':
sfnt.c:(.text+0x627c): undefined reference to `png_create_read_struct'
/usr/bin/ld: sfnt.c:(.text+0x6292): undefined reference to `png_create_info_struct'
/usr/bin/ld: sfnt.c:(.text+0x62b6): undefined reference to `png_set_longjmp_fn'
/usr/bin/ld: sfnt.c:(.text+0x62f7): undefined reference to `png_destroy_read_struct'
/usr/bin/ld: sfnt.c:(.text+0x634a): undefined reference to `png_set_read_fn'
/usr/bin/ld: sfnt.c:(.text+0x6359): undefined reference to `png_read_info'
/usr/bin/ld: sfnt.c:(.text+0x638a): undefined reference to `png_get_IHDR'
/usr/bin/ld: sfnt.c:(.text+0x63e0): undefined reference to `png_set_expand_gray_1_2_4_to_8'
/usr/bin/ld: sfnt.c:(.text+0x63f4): undefined reference to `png_get_valid'
/usr/bin/ld: sfnt.c:(.text+0x6432): undefined reference to `png_set_interlace_handling'
/usr/bin/ld: sfnt.c:(.text+0x6446): undefined reference to `png_set_filler'
/usr/bin/ld: sfnt.c:(.text+0x6455): undefined reference to `png_read_update_info'
/usr/bin/ld: sfnt.c:(.text+0x6486): undefined reference to `png_get_IHDR'
/usr/bin/ld: sfnt.c:(.text+0x64cc): undefined reference to `png_set_read_user_transform_fn'
/usr/bin/ld: sfnt.c:(.text+0x6597): undefined reference to `png_read_image'
/usr/bin/ld: sfnt.c:(.text+0x65a6): undefined reference to `png_read_end'
/usr/bin/ld: sfnt.c:(.text+0x6619): undefined reference to `png_set_gray_to_rgb'
/usr/bin/ld: sfnt.c:(.text+0x6631): undefined reference to `png_set_packing'
/usr/bin/ld: sfnt.c:(.text+0x6641): undefined reference to `png_set_tRNS_to_alpha'
/usr/bin/ld: sfnt.c:(.text+0x6650): undefined reference to `png_set_palette_to_rgb'
/usr/bin/ld: sfnt.c:(.text+0x6663): undefined reference to `png_set_strip_16'
/usr/bin/ld: sfnt.c:(.text+0x667d): undefined reference to `png_set_read_user_transform_fn'
/usr/bin/ld: sfnt.c:(.text+0x66b4): undefined reference to `png_destroy_read_struct'
/usr/bin/ld: /home/ilmu011/Desktop/vcpkg/installed/x64-linux/lib/libfreetype.a(sfnt.c.o): in function `error_callback':
sfnt.c:(.text+0x6759): undefined reference to `png_get_error_ptr'
/usr/bin/ld: sfnt.c:(.text+0x6773): undefined reference to `png_set_longjmp_fn'
/usr/bin/ld: /home/ilmu011/Desktop/vcpkg/installed/x64-linux/lib/libfreetype.a(sfnt.c.o): in function `read_data_from_FT_Stream':
sfnt.c:(.text+0x9d59): undefined reference to `png_get_io_ptr'
/usr/bin/ld: sfnt.c:(.text+0x9d95): undefined reference to `png_get_error_ptr'
/usr/bin/ld: sfnt.c:(.text+0x9da5): undefined reference to `png_error'
/usr/bin/ld: /home/ilmu011/Desktop/vcpkg/installed/x64-linux/lib/libfreetype.a(sfnt.c.o): in function `sfnt_init_face':
sfnt.c:(.text+0x1313e): undefined reference to `BrotliDecoderDecompress'
/usr/bin/ld: /home/ilmu011/Desktop/vcpkg/installed/x64-linux/lib/libfreetype.a(ftbzip2.c.o): in function `ft_bzip2_stream_close':
ftbzip2.c:(.text+0x7d): undefined reference to `BZ2_bzDecompressEnd'
/usr/bin/ld: /home/ilmu011/Desktop/vcpkg/installed/x64-linux/lib/libfreetype.a(ftbzip2.c.o): in function `ft_bzip2_file_fill_output':
ftbzip2.c:(.text+0x127): undefined reference to `BZ2_bzDecompress'
/usr/bin/ld: /home/ilmu011/Desktop/vcpkg/installed/x64-linux/lib/libfreetype.a(ftbzip2.c.o): in function `ft_bzip2_stream_io':
ftbzip2.c:(.text+0x378): undefined reference to `BZ2_bzDecompressEnd'
/usr/bin/ld: ftbzip2.c:(.text+0x3c7): undefined reference to `BZ2_bzDecompressInit'
/usr/bin/ld: /home/ilmu011/Desktop/vcpkg/installed/x64-linux/lib/libfreetype.a(ftbzip2.c.o): in function `FT_Stream_OpenBzip2':
ftbzip2.c:(.text+0x604): undefined reference to `BZ2_bzDecompressInit'
/usr/bin/ld: /home/ilmu011/Desktop/vcpkg/installed/x64-linux/lib/libfreetype.a(ftgzip.c.o): in function `ft_gzip_stream_close':
ftgzip.c:(.text+0x1dd): undefined reference to `inflateEnd'
/usr/bin/ld: /home/ilmu011/Desktop/vcpkg/installed/x64-linux/lib/libfreetype.a(ftgzip.c.o): in function `ft_gzip_file_fill_output':
ftgzip.c:(.text+0x2b1): undefined reference to `inflate'
/usr/bin/ld: /home/ilmu011/Desktop/vcpkg/installed/x64-linux/lib/libfreetype.a(ftgzip.c.o): in function `ft_gzip_file_io':
ftgzip.c:(.text+0x505): undefined reference to `inflateReset'
/usr/bin/ld: /home/ilmu011/Desktop/vcpkg/installed/x64-linux/lib/libfreetype.a(ftgzip.c.o): in function `FT_Stream_OpenGzip':
ftgzip.c:(.text+0x6b1): undefined reference to `inflateInit2_'
/usr/bin/ld: ftgzip.c:(.text+0x85f): undefined reference to `inflateEnd'
/usr/bin/ld: /home/ilmu011/Desktop/vcpkg/installed/x64-linux/lib/libfreetype.a(ftgzip.c.o): in function `FT_Gzip_Uncompress':
ftgzip.c:(.text+0x984): undefined reference to `inflateInit2_'
/usr/bin/ld: ftgzip.c:(.text+0x998): undefined reference to `inflate'
/usr/bin/ld: ftgzip.c:(.text+0x9a7): undefined reference to `inflateEnd'
/usr/bin/ld: ftgzip.c:(.text+0xa1c): undefined reference to `inflateEnd'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/CylinderExample.dir/build.make:145: CylinderExample] Error 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/CylinderExample.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

```

When I try to do this with the built-from-source installation (9.1), nothing changes. make simply does nothing. But it looks like, in that case, cmake doesn’t even recognize vtk at all. I tried leaving out the vtk directory to the installation and no errors where thrown. I begin to suspect that cmake doesn’t even find vtk in the first place and weirdly doesn’t even throw any error messages

---

<div class="post-metadata">

### Author: ![Ilmu011](https://discourse.vtk.org/user_avatar/discourse.vtk.org/ilmu011/32/4237_2.png) [@Ilmu011](https://discourse.vtk.org/u/Ilmu011)
#### Post date: [March 15, 2022, 2:54pm UTC](https://discourse.vtk.org/t/cant-build-vtk-sample-project-missing-module/8056/11 "2022-03-15T14:54:08Z")

</div>

I also just tried to add

`set(VTK_MODULE_ENABLE_VTK_RenderingContextOpenGL2 YES)`

to my cmake file and also tried it with the command line option, but the missing module error still ocurs (in the vcpkg installation; the source installation stil seems to be unrecognized for whatever reason)

---

<div class="post-metadata">

### Author: ![dgobbi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dgobbi/32/18_2.png) [@dgobbi](https://discourse.vtk.org/u/dgobbi)
#### Post date: [March 15, 2022, 3:09pm UTC](https://discourse.vtk.org/t/cant-build-vtk-sample-project-missing-module/8056/12 "2022-03-15T15:09:26Z")

</div>

To get rid of the “undefined reference” errors, try removing `vtkRenderingFreeType` from the `COMPONENTS` as well. I say this because all of the warnings mention `libfreetype.a`.

There must be something wrong with the vcpkg for VTK, because if the package was correct, then `vtkRenderingFreeType` would automatically link to `libpng` and to all the other libraries that `libfreetype` needs.

Please note that I don’t have any experience with vcpkg, so my answers might not be correct.

* * *

Edit: another possibility is that you have more than one `libfreetype` installed on your system, and cmake is finding the wrong one. For example, maybe one `libfreetype` was installed from a ubuntu package and another from vcpkg.

---

<div class="post-metadata">

### Author: ![Ilmu011](https://discourse.vtk.org/user_avatar/discourse.vtk.org/ilmu011/32/4237_2.png) [@Ilmu011](https://discourse.vtk.org/u/Ilmu011)
#### Post date: [March 15, 2022, 3:23pm UTC](https://discourse.vtk.org/t/cant-build-vtk-sample-project-missing-module/8056/13 "2022-03-15T15:23:37Z")

</div>

That didn’t solve the problem either.

Fine, let’s say the vcpkg version is broken, I still don’t understand how cmake seems to completely ignore the source installation despite me providing the installation directory. It doesn’t even throw error messages, it simply does nothing.

I built the source installation with the ccmake command, are there any settings I had to adjust? For example, CMAKE\_BUILD\_TYPE is set to “Debug”, shouldn’t that be Release? Is that even important? I have no idea how to make this work. I followed every step of the installation steps prvided here: [https://gitlab.kitware.com/vtk/vtk/-/blob/master/Documentation/dev/build.md](https://gitlab.kitware.com/vtk/vtk/-/blob/master/Documentation/dev/build.md)

At this point I am just trying to get a working VTK installation.

---

<div class="post-metadata">

### Author: ![Ilmu011](https://discourse.vtk.org/user_avatar/discourse.vtk.org/ilmu011/32/4237_2.png) [@Ilmu011](https://discourse.vtk.org/u/Ilmu011)
#### Post date: [March 15, 2022, 3:28pm UTC](https://discourse.vtk.org/t/cant-build-vtk-sample-project-missing-module/8056/14 "2022-03-15T15:28:40Z")

</div>

I just checked libfreetype installations, it seems to be the case that there is both an apt installation and a vcpkg one. But which is the right one and how do I make it so that the right one is used?

---

<div class="post-metadata">

### Author: ![Ilmu011](https://discourse.vtk.org/user_avatar/discourse.vtk.org/ilmu011/32/4237_2.png) [@Ilmu011](https://discourse.vtk.org/u/Ilmu011)
#### Post date: [March 15, 2022, 3:42pm UTC](https://discourse.vtk.org/t/cant-build-vtk-sample-project-missing-module/8056/15 "2022-03-15T15:42:17Z")

</div>

Regarding the source installation: I just checked the CMakeCache.txt in the build folder. I found this entry:

```auto
//The directory containing a CMake configuration file for VTK.
VTK_DIR:PATH=VTK_DIR-NOTFOUND

```

The directory I specified isn’t applied. Am I giving cmake the wrong directory? I just assumed (following the build directions) I had to point to “vtk/build”. The instructions say

If VTK is not installed but compiled on your system, you will need to specify the path to your VTK build:

```auto
cmake -DVTK_DIR:PATH=/home/me/vtk_build ..

```

…but this clearly failed

---

<div class="post-metadata">

### Author: ![Ilmu011](https://discourse.vtk.org/user_avatar/discourse.vtk.org/ilmu011/32/4237_2.png) [@Ilmu011](https://discourse.vtk.org/u/Ilmu011)
#### Post date: [March 15, 2022, 4:07pm UTC](https://discourse.vtk.org/t/cant-build-vtk-sample-project-missing-module/8056/16 "2022-03-15T16:07:52Z")

</div>

I just found out, that I was using the wrong directory all along. I had to specify the directory containing the config-cmake file for vtk like this:

```auto

cmake -S source -B build -DVTK_DIR:PATH=/home/ilmu011/Desktop/vtk/build/lib/cmake/vtk-9.1

```

However, now I get a massive error log:

> **[CMake Error at...](https://pastebin.com/pEQ7x7GF)**
>
> Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.

---

<div class="post-metadata">

### Author: ![dgobbi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dgobbi/32/18_2.png) [@dgobbi](https://discourse.vtk.org/u/dgobbi)
#### Post date: [March 15, 2022, 4:31pm UTC](https://discourse.vtk.org/t/cant-build-vtk-sample-project-missing-module/8056/17 "2022-03-15T16:31:12Z")

</div>

The error log is because VTK wasn’t built, so all of the library targets that cmake needs are missing.

For now, I suggest going back to the vcpkg vtk, because if that works, it will be the simplest way forward.

The problem there was `libfreetype` and the missing symbols, so try re-configuring your example against the vcpkg vtk, and then look through the generated CMakeCache.txt for freetype and other system libraries, and make sure they point to the apt-installed libraries. E.g.:

```nohighlight
FREETYPE_INCLUDE_DIR_freetype2:PATH=/usr/include/freetype2
FREETYPE_INCLUDE_DIR_ft2build:PATH=/usr/include/freetype2
FREETYPE_LIBRARY_DEBUG:FILEPATH=FREETYPE_LIBRARY_DEBUG-NOTFOUND
FREETYPE_LIBRARY_RELEASE:FILEPATH=/usr/lib/x86_64-linux-gnu/libfreetype.so

```

It’s fine if the “DEBUG” versions of these libraries are “NOTFOUND”. I also recommend setting `CMAKE_BUILD_TYPE` to `Release` unless you specifically intend to run the example in a debugger.

---

<div class="post-metadata">

### Author: ![Ilmu011](https://discourse.vtk.org/user_avatar/discourse.vtk.org/ilmu011/32/4237_2.png) [@Ilmu011](https://discourse.vtk.org/u/Ilmu011)
#### Post date: [March 15, 2022, 4:39pm UTC](https://discourse.vtk.org/t/cant-build-vtk-sample-project-missing-module/8056/18 "2022-03-15T16:39:23Z")

</div>

Where would I configure these things? In the CMakeLists.txt? Like  
`set(FREETYPE_INCLUDE_DIR_freetype2 "/usr/include/freetype2")`  
?

---

<div class="post-metadata">

### Author: ![Ilmu011](https://discourse.vtk.org/user_avatar/discourse.vtk.org/ilmu011/32/4237_2.png) [@Ilmu011](https://discourse.vtk.org/u/Ilmu011)
#### Post date: [March 15, 2022, 4:42pm UTC](https://discourse.vtk.org/t/cant-build-vtk-sample-project-missing-module/8056/19 "2022-03-15T16:42:19Z")

</div>

Also, is it really more complicated to just build the VTK from source?  
The instructions used ccmake for this step, but I’m not familiar with that tool and probably missed some steps

---

<div class="post-metadata">

### Author: ![Ilmu011](https://discourse.vtk.org/user_avatar/discourse.vtk.org/ilmu011/32/4237_2.png) [@Ilmu011](https://discourse.vtk.org/u/Ilmu011)
#### Post date: [March 15, 2022, 4:50pm UTC](https://discourse.vtk.org/t/cant-build-vtk-sample-project-missing-module/8056/20 "2022-03-15T16:50:29Z")

</div>

I did check the Cache and it turns out it DOES point to the vcpkg installation. However, isn’t this the point? I thought vcpkg handled dependencies like these automatically. How is it possible that this version is incompatible with vtk?

[Next page](https://discourse.vtk.org/t/cant-build-vtk-sample-project-missing-module/8056.md?page=2)
