When compiling some code with opencv
I get this error
# g++ txtbin-03.1.cpp -o txtbin `pkg-config opencv --cflags --libs`
/usr/bin/ld: cannot fi
libippicv.a is a third party library, so you need to explicitly provide it during compilation or make it part of your execution environment.
It is located in ~/OpenCV/opencv-3.1.0/3rdparty/ippicv/unpack/ippicv_lnx/lib/intel64/
Also, provide cmake -DWITH_IPP=ON at the time of Makefile generation.
In my case, all it took was to copy libippicv.a from the OpenCV SDK to /usr/local/lib:
sudo cp 3rdparty/ippicv/unpack/ippicv_lnx/lib/intel64/libippicv.a /usr/local/lib/
I was running into the same problem while trying to install the opencv_contrib repository (opencv-3.1.0/Ubuntu 16.04), and none of the solutions worked (I tried to make OpenCV with flag WITH_IPP=ON
, but somehow OpenCV 3.1.0 failed to download the ippicv
library(?) and there was no error prompt so I only figured this out when I tried to locate ippicv
in terminal).
My solution was to download another OpenCV build (3.0.0 worked for me), make + make install with flag WITH_IPP=ON
, and then copy the downloaded ippicv library (which should be located in /usr/local/share/OpenCV/3rdparty/lib/libippicv.a
by now) to /usr/local/lib/
.
I don't know if this is a known bug in OpenCV 3.1.0, but this one is definitely worth keeping an eye out for.
Recompile OpenCv using following option:
cmake -DWITH_IPP=ON . && make -j $(nproc) && make install
Recompiling whole library isn't necessary, especially if you don't need this library. I found great and instantly working solution here. In case link expired or broke:
The solution is simply to remove -lippicv
from opencv pkg-config configuration file. So you have to locate opencv.pc
file, which default is in /usr/local/lib/pkgconfig/
directory. Then from section Libs:
just remove aforementioned library.