Я установил OpenCV с помощью команды Pacman. Но я получаю сотни строк ошибок при связывании. Я скомпилировал свою программу с помощью команды
gcc example.cpp -o example `pkg-config --cflags --libs opencv4`
и небольшая часть ошибки компоновки выглядит следующим образом.
usr/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../lib/libopencv_viz.so: undefined reference to `vtkRenderingFreeType_AutoInit_Destruct()'
/usr/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../lib/libopencv_viz.so: undefined reference to `vtkInteractorStyle::StartTwoPointer()'
/usr/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../lib/libopencv_viz.so: undefined reference to `vtkInteractorStyle::EndZoom()'
/usr/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../lib/libopencv_viz.so: undefined reference to `vtkSmartPointerBase::operator=(vtkObjectBase*)'
/usr/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../lib/libopencv_viz.so: undefined reference to `vtkOStrStreamWrapper::freeze(int)'
/usr/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../lib/libopencv_viz.so: undefined reference to `vtkCamera::SetUserTransform(vtkHomogeneousTransform*)'
/usr/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../lib/libopencv_viz.so: undefined reference to `vtkCommand::UnRegister()'
/usr/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../lib/libopencv_viz.so: undefined reference to `vtkRenderer::New()'
/usr/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../lib/libopencv_viz.so: undefined reference to `vtkInteractorStyle::StartDolly()'
/usr/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../lib/libopencv_viz.so: undefined reference to `vtkRenderer::SetActiveCamera(vtkCamera*)'
/usr/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../lib/libopencv_viz.so: undefined reference to `vtkInteractorObserver::ReleaseFocus()'
/usr/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../lib/libopencv_viz.so: undefined reference to `vtkInteractorObserver::ComputeDisplayToWorld(double, double, double, double*)'
/usr/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../lib/libopencv_viz.so: undefined reference to `vtkAlgorithm::Update(vtkInformation*)'
/usr/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../lib/libopencv_viz.so: undefined reference to `vtkMatrix4x4::New()'