Thanks for the help, but I am ending up with the same errors over and over again. I removed all the versions of OpenCV and reinstalled OpenCV 2.4.9 following the instructions outlined here (
http://www.samontab.com/web/2014/06/installing-opencv-2-4-9-in-ubuntu-14-04-lts/). Next, I type this in the terminal
export LD_LIBRARY_PATH =/usr/local/lib and when I run make test, I get the following:
CXX/LD -o .build_release/test/test_all.testbin src/caffe/test/test_caffe_main.cpp
/usr/bin/ld: cannot find -llibopencv_core.so.2.4
/usr/bin/ld: cannot find -llibopencv_highgui.so.2.4
/usr/bin/ld: cannot find -lopencv_imgproc.so.2.4
/usr/bin/ld: cannot find -llibopencv_imgcodecs.so.2.4
/usr/bin/ld: cannot find -llibopencv_core.so.2.4
/usr/bin/ld: cannot find -llibopencv_highgui.so.2.4
/usr/bin/ld: cannot find -llibopencv_imgproc.so.2.4
collect2: error: ld returned 1 exit status
make: *** [.build_release/test/test_all.testbin] Error 1
The output of pkg-config --libs opencv gives me /usr/local/lib/libopencv_calib3d.so /usr/local/lib/libopencv_contrib.so /usr/local/lib/libopencv_core.so /usr/local/lib/libopencv_features2d.so /usr/local/lib/libopencv_flann.so /usr/local/lib/libopencv_gpu.so /usr/local/lib/libopencv_highgui.so /usr/local/lib/libopencv_imgproc.so /usr/local/lib/libopencv_legacy.so /usr/local/lib/libopencv_ml.so /usr/local/lib/libopencv_nonfree.so /usr/local/lib/libopencv_objdetect.so /usr/local/lib/libopencv_ocl.so /usr/local/lib/libopencv_photo.so /usr/local/lib/libopencv_stitching.so /usr/local/lib/libopencv_superres.so /usr/local/lib/libopencv_ts.a /usr/local/lib/libopencv_video.so /usr/local/lib/libopencv_videostab.so /usr/local/lib/libopencv_viz.so /usr/lib/x86_64-linux-gnu/libXext.so /usr/lib/x86_64-linux-gnu/libX11.so /usr/lib/x86_64-linux-gnu/libICE.so /usr/lib/x86_64-linux-gnu/libSM.so /usr/lib/x86_64-linux-gnu/libGL.so /usr/lib/x86_64-linux-gnu/libGLU.so -ltbb -lrt -lpthread -lm -ldl.
Similarly, the output of pkg-config --cflags opencv gives me the following -I/usr/local/include/opencv -I/usr/local/include. From this, I am assuming that opencv installation has gone smoothly and I have followed what you have asked me to do. I did not set the LD_LIBRARY_PATH in a path file, because I came across multiple websites warning against permanently setting the LD_LIBRARY_PATH. Is there something I am not picking up here or doing wrong?