Reputation: 1
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 find -lippicv
collect2: error: ld returned 1 exit status
# apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
# apt-get install libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev
# cd /var/bin && git clone https://github.com/Itseez/opencv.git && cd opencv
# cmake . && make -j2 && make install
Upvotes: 9
Views: 22344
Reputation: 21
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.
Upvotes: 0
Reputation: 132
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.
Upvotes: 5
Reputation: 21
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.
Upvotes: 0
Reputation: 151
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/
Upvotes: 15
Reputation: 877
Recompile OpenCv using following option:
cmake -DWITH_IPP=ON . && make -j $(nproc) && make install
Upvotes: 4