title: pkg-config --cflags opencv: No such file or directory
body: <p>I'm writing a basic example of opencv, but <strong>make</strong> command give me message</p>
  <blockquote>
  <p>g++-4.7.real: error: pkg-config --cflags opencv: No such file or directory</p>
  <p>g++-4.7.real: error: pkg-config --libs opencv: No such file or directory</p>
  </blockquote>
  <p>issue command <strong>pkg-config --cflag opencv</strong> give me result as:</p>
  <blockquote>
  <p>-I/usr/local/include/opencv -I/usr/local/include</p>
  </blockquote>
  <p>and <strong>pkg-config --libs opencv</strong> give me:</p>
  <blockquote>
  <p>-I/usr/local/include/opencv -I/usr/local/include<br />
  vudao@vudaopc:~/work/nmath/ntrainer$ pkg-config --libs opencv
  /usr/local/lib/libopencv_contrib.a /usr/local/lib/libopencv_stitching.a /usr/local/lib/libopencv_nonfree.a /usr/local/lib/libopencv_superres.a /usr/local/lib/libopencv_ocl.a /usr/local/lib/libopencv_ts.a /usr/local/lib/libopencv_videostab.a /usr/local/lib/libopencv_gpu.a /usr/local/lib/libopencv_photo.a /usr/local/lib/libopencv_objdetect.a /usr/local/lib/libopencv_legacy.a /usr/local/lib/libopencv_video.a /usr/local/lib/libopencv_ml.a /usr/local/lib/libopencv_calib3d.a /usr/local/lib/libopencv_features2d.a /usr/local/lib/libopencv_highgui.a /usr/local/share/OpenCV/3rdparty/lib/libIlmImf.a /usr/local/share/OpenCV/3rdparty/lib/liblibjasper.a /usr/local/share/OpenCV/3rdparty/lib/liblibtiff.a /usr/local/lib/libopencv_imgproc.a /usr/local/lib/libopencv_flann.a /usr/local/lib/libopencv_core.a /usr/lib/i386-linux-gnu/libbz2.so /usr/lib/i386-linux-gnu/libpng.so /usr/lib/i386-linux-gnu/libjpeg.so /usr/lib/i386-linux-gnu/libz.so -lswscale -lavformat -lavutil -lz -lSDL -lasound -lavcodec -lgthread-2.0 -lglib-2.0 -lgobject-2.0 -lfontconfig -lfreetype -lpango-1.0 -lcairo -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lpangoft2-1.0 -lgio-2.0 -latk-1.0 -lgdk-x11-2.0 -lgtk-x11-2.0 -lrt -lpthread -lm -ldl -lstdc++</p>
  </blockquote>
  <p>Below is my Makefile:</p>
  <pre><code>CC=g++
  CFLAGS=-O2 -g 'pkg-config --cflags opencv'
  LDFLAGS='pkg-config --libs opencv'
  
  BIN=ntrainer
  
  ntrainer : ntrainer.cpp
      $(CC) $(CFLAGS) $(LDFLAGS) -o $(BIN) ntrainer.cpp
  </code></pre>
  <p>My system is Ubuntu 12.10. I have installed opencv-2.4.7 successfully (I think) following instructions here <a href="http://www.samontab.com/web/2011/06/installing-opencv-2-2-in-ubuntu-11-04/" rel="nofollow noreferrer">http://www.samontab.com/web/2011/06/installing-opencv-2-2-in-ubuntu-11-04/</a></p>
  <p>I also have configured and exported PKG_CONFIG_PATH into /etc/bash.bashrc, I'v also ran <strong>ldconfig</strong></p>
  <p>Please someone tell me what I'm missing? And how to correct it.
  Thanks too much.</p>