wprins
wprins

Reputation: 876

Adding opencv lib to custom lib, errors with ipp?

I'm bundling openCV into an SDK for people developing in C++ in linux. I'm linking a test executable with my built library and its giving me a huge dump of errors, one of which is:

/path/to/build/libopencv_core.a(copy.cpp.o): In function `cv::Mat::setTo(cv::_InputArray const&, cv::_InputArray const&)':
copy.cpp:(.text._ZN2cv3Mat5setToERKNS_11_InputArrayES3_+0x15c1): undefined reference to `ippicviSet_32f_C1MR'
copy.cpp:(.text._ZN2cv3Mat5setToERKNS_11_InputArrayES3_+0x1700): undefined reference to `ippicviSet_32f_C4MR'
copy.cpp:(.text._ZN2cv3Mat5setToERKNS_11_InputArrayES3_+0x1743): undefined reference to `ippicviSet_32s_C4MR'
copy.cpp:(.text._ZN2cv3Mat5setToERKNS_11_InputArrayES3_+0x17a4): undefined reference to `ippicviSet_16s_C4MR'
copy.cpp:(.text._ZN2cv3Mat5setToERKNS_11_InputArrayES3_+0x1805): undefined reference to `ippicviSet_16u_C4MR'

What is this error referencing? Should I be building without ipp? I compiled the opencv libs -fPIC and standalone. I'm actually getting thousands of errors which have some mention of ippicvi and this is just an example.

Upvotes: 1

Views: 546

Answers (1)

Alexandru Irimiea
Alexandru Irimiea

Reputation: 2634

I had the same error. You need to link the executable to the library libippicv.

This is a 3rd party library used by OpenCV an you can find it in /usr/local/share/OpenCV/3rdparty/lib/libippicv.a.

You can also find in opencv.pc all the dependencies used by OpenCV. E.g.:

/usr/local/lib/pkgconfig/opencv.pc

# Package Information for pkg-config

prefix=/usr/local exec_prefix=${prefix} libdir=${exec_prefix}/lib includedir_old=${prefix}/include/opencv includedir_new=${prefix}/include

Name: OpenCV
Description: Open Source Computer Vision Library
Version: 3.2.0

Libs: -L${exec_prefix}/lib -lopencv_shape -lopencv_stitching -lopencv_objdetect -lopencv_superres -lopencv_videostab -lopencv_calib3d -lopencv_features2d -lopencv_highgui -lopencv_videoio -lopencv_imgcodecs -lopencv_video -lopencv_photo -lopencv_ml -lopencv_imgproc -lopencv_flann -lopencv_core

Libs.private: -L${exec_prefix}/share/OpenCV/3rdparty/lib -llibwebp -lippicv -L/usr/lib/x86_64-linux-gnu -lpng -lz -ltiff -ljasper -ljpeg -lImath -lIlmImf -lIex -lHalf -lIlmThread -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype -lgthread-2.0 -ldc1394 -lavcodec-ffmpeg -lavformat-ffmpeg -lavutil-ffmpeg -lswscale-ffmpeg -lstdc++ -ldl -lm -lpthread -lrt Cflags: -I${includedir_old} -I${includedir_new}

Upvotes: 2

Related Questions