title: I am getting linking error while compilong opencv4 basic program?
body: <p>I installed the OpenCV with the Pacman command. But i am getting hundred of lines of linking error. I compiled my program with the command</p>
  
  <pre><code>gcc example.cpp -o example `pkg-config --cflags --libs opencv4`
  </code></pre>
  
  <p>and the small part of the linking error is as follows.</p>
  
  <pre><code>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()'
  </code></pre>