title: OpenCV linker error with libraries after update
body: <p>I was using OpenCV but for some reason needed to install it again!
  But my program doesn't compile now!
  My compile script is:</p>
  
  <pre><code>#!/bin/sh
  if [ $# -gt 0 ] ; then
  #   base=`basename $1 .c`
  #   echo "compiling $base"
  #   gcc -ggdb `pkg-config opencv --cflags --libs` $base.c -o $base 
  
  #   base=`basename $1 .cpp`
      echo "compiling $1"
      g++ -ggdb `pkg-config --cflags opencv` -o `basename $1 .cpp` $1 `pkg-config --libs opencv`;
  #   gcc -ggdb `pkg-config opencv --cflags --libs` $base.c -o $base 
  
  else
      for i in *.c; do
          echo "compiling $i"
          gcc -ggdb `pkg-config --cflags opencv` -o `basename $i .c` $i `pkg-config --libs opencv`;
      done
      for i in *.cpp; do
          echo "compiling $i"
          g++ -ggdb `pkg-config --cflags opencv` -o `basename $i .cpp` $i `pkg-config --libs opencv`;
      done
  fi
  </code></pre>
  
  <p>and when I use it like <code>./build_all.sh test10Camera.cpp</code> it doesn't work the output and error is:</p>
  
  <pre><code>compiling test10Camera.cpp
  /usr/bin/ld: warning: libtbb.so, needed by /usr/local/lib/libopencv_core.so, not found (try using -rpath or -rpath-link)
  /usr/local/lib/libopencv_core.so: undefined reference to `tbb::task_scheduler_init::initialize(int)'
  /usr/local/lib/libopencv_core.so: undefined reference to `tbb::task::note_affinity(unsigned short)'
  /usr/local/lib/libopencv_imgproc.so: undefined reference to `tbb::internal::handle_perror(int, char const*)'
  /usr/local/lib/libopencv_core.so: undefined reference to `tbb::internal::allocate_child_proxy::allocate(unsigned int) const'
  /usr/local/lib/libopencv_core.so: undefined reference to `tbb::task_group_context::is_group_execution_cancelled() const'
  /usr/local/lib/libopencv_core.so: undefined reference to `tbb::task_scheduler_init::terminate()'
  /usr/local/lib/libopencv_core.so: undefined reference to `tbb::task_scheduler_init::initialize(int, unsigned int)'
  /usr/local/lib/libopencv_core.so: undefined reference to `typeinfo for tbb::task'
  /usr/local/lib/libopencv_core.so: undefined reference to `tbb::internal::allocate_continuation_proxy::allocate(unsigned int) const'
  /usr/local/lib/libopencv_core.so: undefined reference to `vtable for tbb::task'
  /usr/local/lib/libopencv_core.so: undefined reference to `tbb::internal::allocate_root_with_context_proxy::free(tbb::task&amp;) const'
  /usr/local/lib/libopencv_core.so: undefined reference to `tbb::task_group_context::init()'
  /usr/local/lib/libopencv_core.so: undefined reference to `tbb::task_scheduler_init::default_num_threads()'
  /usr/local/lib/libopencv_core.so: undefined reference to `tbb::internal::get_initial_auto_partitioner_divisor()'
  /usr/local/lib/libopencv_core.so: undefined reference to `tbb::task_group_context::~task_group_context()'
  /usr/local/lib/libopencv_core.so: undefined reference to `tbb::internal::allocate_root_with_context_proxy::allocate(unsigned int) const'
  collect2: ld returned 1 exit status
  </code></pre>
  
  <p>What is wrong and what should I do?</p>