many "undefined references" error in building vtk on raspberry pi 4

cmake version: 2.22

Did you mean cmake 3.22?

In order to build VTK, several dev packages are required. I’m not sure what the complete list is, but you can try installing these with apt-get:

The essential packages:

build-essential cmake

Various libraries:

libfreetype6-dev libfontconfig1-dev
libgl-dev libglu-dev
libx11-dev libxpm-dev libxt-dev x11proto-core-dev

Qt libraries:

libqt5opengl5-dev libqt5webkit5-dev libqt5x11extras5-dev qtbase5-dev qttools5-private-dev

Python libraries (if you use Python)

python3-dev python3-matplotlib python3-six python3-twisted

Edit: I removed some packages that VTK will build itself.

2 Likes