opencv compiling error ippicv

When I write this to terminal:

g++ LATCH_match.cpp -std=c++11 $(pkg-config opencv --cflags --libs)

I've got an error like this:

/usr/bin/ld: cannot find -lippicv
collect2: error: ld returned 1 exit status

I've tried a lot of things but I couldn't find a solution.

3

3 Answers

If you have verified that installation was made after compilation, then you can update pkgconfig for opencv (/usr/local/lib/pkgconfig/opencv.pc) to include 3rd party. Use below as a guide to update it

# Package Information for pkg-config
prefix=/usr/local
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
libdir3rd=${exec_prefix}/share/OpenCV/3rdparty/lib
includedir_old=${prefix}/include/opencv
includedir_new=${prefix}/include
Name: OpenCV
Description: Open Source Computer Vision Library
Version: 3.1.0
Libs: -L${libdir} -L${libdir3rd} -lopencv_shape -lopencv_stitching -lopencv_objdetect -lopencv_superres -lopencv_videostab -lippicv -lopencv_calib3d -lopencv_features2d -lopencv_highgui -lopencv_videoio -lopencv_imgcodecs -lopencv_video -lopencv_photo -lopencv_ml -lopencv_imgproc -lopencv_flann -lopencv_core -lopencv_ts
Libs.private: -L/usr/lib/x86_64-linux-gnu -lQt5Core -lQt5Gui -lQt5Widgets -lQt5Test -lQt5Concurrent -lQt5OpenGL -lwebp -lpng -lz -ltiff -ljasper -ljpeg -lImath -lIlmImf -lIex -lHalf -lIlmThread -lgstvideo-1.0 -lgstapp-1.0 -lgstbase-1.0 -lgstriff-1.0 -lgstpbutils-1.0 -lgstreamer-1.0 -lgobject-2.0 -lglib-2.0 -ldc1394 -lv4l1 -lv4l2 -lavcodec -lavformat -lavutil -lswscale -lavresample -lgphoto2 -lgphoto2_port -lexif -ldl -lm -lpthread -lrt -lGLU -lGL -ltbb -latomic
Cflags: -I${includedir_old} -I${includedir_new}

Okay, I have precisely the same problem. I did recompile with -DWITH_IPP=ON, and there are no build error, or install errors. It looks like the installer put libippicv at the following path:

/usr/local/share/OpenCV/3rdparty/lib/libippicv.a

But then the installed file /usr/local/lib/pkgconfig/opencv.pc just references -lippicv, WITHOUT giving the correct path. So I think something is broken.

You can simply add a symbolic link in /lib directory to work around it:

cd /lib
sudo ln -s /usr/local/share/OpenCV/3rdparty/lib/libippicv.a libippicv.a

(assuming your library is in /usr/local/share/OpenCV/3rdparty/lib)

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like