9

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

installing opencv

# 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
clarkk
  • 27,151
  • 72
  • 200
  • 340
  • Did you check this question and answers? http://stackoverflow.com/questions/25726768/opencv-3-0-trouble-with-installation – akhisp Dec 21 '15 at 19:04

5 Answers5

15

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/
iowarod
  • 151
  • 3
5

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.

hurin
  • 114
  • 1
  • 5
4

Recompile OpenCv using following option:

cmake -DWITH_IPP=ON . && make -j $(nproc) && make install
Dipak D Desai
  • 867
  • 1
  • 8
  • 20
0

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.

H.B
  • 21
  • 2
0

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.

Nathan Tuggy
  • 2,237
  • 27
  • 30
  • 38
zeklewa
  • 21
  • 2