Installation of OpenCV in a local directory in Ubuntu 16.04
I have successfully installed OpenCV 2.4.13 in a local directory in my system. But, I am unable to run a sample code and it is giving the error -
g++ -L/home/zeus/Libraries/opencv-2.4.13/release/install/lib -I/home/zeus/Libraries/opencv-2.4.13/release/install/include test.cpp -o test
/tmp/ccUdWpdH.o: In function main':
test.cpp:(.text+0xb9): undefined reference to
cv::imread(std::__cxx11::basic_string<char, std::char_traits<char="">, std::allocator<char> > const&, int)'
test.cpp:(.text+0xe1): undefined reference to cv::waitKey(int)'
test.cpp:(.text+0x101): undefined reference to
cv::_InputArray::_InputArray(cv::Mat const&)'
test.cpp:(.text+0x144): undefined reference to cv::imshow(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cv::_InputArray const&)'
/tmp/ccUdWpdH.o: In function
cv::Mat::~Mat()':
test.cpp:(.text._ZN2cv3MatD2Ev[_ZN2cv3MatD5Ev]+0x39): undefined reference to cv::fastFree(void*)'
/tmp/ccUdWpdH.o: In function
cv::Mat::release()':
test.cpp:(.text._ZN2cv3Mat7releaseEv[_ZN2cv3Mat7releaseEv]+0x47): undefined reference to `cv::Mat::deallocate()'
collect2: error: ld returned 1 exit status
Makefile:9: recipe for target 'test' failed
make: * [test] Error 1
My OpenCV is installed in /home/zeus/Libraries/opencv-2.4.13/release/install/
PS - I want to install it locally for some reasons. Please don't tell me to install it in /usr/lib/ as I don't want to do it that way.