#the source directory would change depending on where you install it
#output errors while compiling are very useful to debug
export LD_LIBRARY_PATH=/usr/src/opencv/release/lib/:$LD_LIBRARY_PATH
ldconfig
PKG_CONFIG_PATH=/usr/src/lib/pkgconfig:${PKG_CONFIG_PATH}
export PKG_CONFIG_PATH
ldconfig
#some examples and guidelines here
linuxconfig.org/introduction-to-computer-vision-with-opencv-on-linux
#compiling
g++ `pkg-config opencv --cflags --libs` example21.cpp -o example21
#output errors while compiling are very useful to debug
export LD_LIBRARY_PATH=/usr/src/opencv/release/lib/:$LD_LIBRARY_PATH
ldconfig
PKG_CONFIG_PATH=/usr/src/lib/pkgconfig:${PKG_CONFIG_PATH}
export PKG_CONFIG_PATH
ldconfig
#some examples and guidelines here
linuxconfig.org/introduction-to-computer-vision-with-opencv-on-linux
#compiling
g++ `pkg-config opencv --cflags --libs` example21.cpp -o example21