Ask Your Question

missionary's profile - activity

2017-03-28 04:15:48 -0600 asked a question OpenCV 3.1.0: /usr/bin/ld: cannot find -lippicv

I have installed OpenCV 3.1.0 locally in my home directory. Also I have exported the following paths -

export PYTHONPATH="/home/zeus/Libraries/opencv-3.1.0/release/install/lib/python2.7/dist-packages"
export LD_LIBRARY_PATH="/home/zeus/Libraries/opencv-3.1.0/release/install/lib"
export PKG_CONFIG_PATH="/home/zeus/Libraries/opencv-3.1.0/release/install/lib/pkgconfig"

But, when I am trying to compile a program using g++ $1 -o $2 pkg-config --cflags --libs opencv it gives the following error - /usr/bin/ld: cannot find -lippicv collect2: error: ld returned 1 exit status

How can I fix this? The link for -lippicv is there in the pkgconfig of OpenCV3.1.0 but, why is it not present in the lib folder? I can remove it from the pkgconfig file so that it doesn't show that error but, I want to know why this is happening?

2017-03-28 02:36:29 -0600 asked a question Import Error: Python unable to detect OpenCV libraries for OpenCV local installation

I have installed OpenCV locally in a directory named /home/zeus/Libraries/opencv-2.4.13/release/install. C++ programs are working fine as I have configured the shared libraries so that they are detected from the local install. However, on running import cv2 in the python shell is giving the following error -

ImportError: Traceback (most recent call last)
<ipython-input-1-5689afc08b90> in <module>()
----> 1 import cv2 as cv

ImportError: No module named cv2

Therefore, I need to give some path for python to detect the opencv library cv2.so which is stored in /home/zeus/Libraries/opencv-2.4.13/release/install/lib/python2.7/dist-packages/ which is a local directory. How can I do that?

2017-03-28 02:21:00 -0600 commented answer Installation of OpenCV in a local directory in Ubuntu 16.04

Thank you very much for your help! I have finally got it working. I created a file named opencv.conf in /etc/ld.so.conf.d/, then added the path of the local directory where I had installed the libraries and then I ran sudo ldconfig -v to link the shared library search path.

2017-03-27 11:10:55 -0600 received badge  Editor (source)
2017-03-27 11:10:22 -0600 commented answer Installation of OpenCV in a local directory in Ubuntu 16.04

This resolved my make problem. But, while running the executable I am getting the following error - ./run: error while loading shared libraries: libopencv_highgui.so.2.4: cannot open shared object file: No such file or directory

2017-03-27 07:48:26 -0600 asked a question 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 tocv::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 tocv::_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 functioncv::Mat::~Mat()': test.cpp:(.text._ZN2cv3MatD2Ev[_ZN2cv3MatD5Ev]+0x39): undefined reference to cv::fastFree(void*)' /tmp/ccUdWpdH.o: In functioncv::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.