Can't build VTK sample project: Missing module

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.