Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

compiling code with opencv - /usr/bin/ld: cannot find -lippicv

Tags:

c++

opencv

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
like image 765
clarkk Avatar asked Dec 21 '15 17:12

clarkk


3 Answers

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/
like image 51
iowarod Avatar answered Nov 15 '22 21:11

iowarod


Recompile OpenCv using following option:

cmake -DWITH_IPP=ON . && make -j $(nproc) && make install
like image 28
Dipak D Desai Avatar answered Nov 15 '22 20:11

Dipak D Desai


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.

like image 5
hurin Avatar answered Nov 15 '22 21:11

hurin