Opencv4: Undefined reference to ippiw library symbols
Hello experts,
I'm trying to build simple program on Ubuntu 18.04. I had downloaded sources and built using cmake and make (GCC). I used depricated flag -DOPENCV_GENERATE_PKG_CONFIG. Of course, file created had wrong content, but it wasn't hard to fix that.
On the begining I was using pkg-config but because of number of errors I decided to simplify code and compilation command defining explicitly libraries for linker. In the end I have code:
#include <iostream>
#include "opencv2/core.hpp"
using namespace std;
using namespace cv;
int main(int argc, char** argv)
{
Mat I;
return 0;
}
and command line to compile:
g++ cout_mat.cpp -L../opencv_build/lib -L../opencv_build/3rdparty/lib -lopencv_core -lzlib -lippiw `pkg-config --cflags opencv4` -o cout_exe
where pkg-config --cflags resolves to:
-I/home/andrew/opencv/opencv-4.4.0_src/modules/calib3d/include
-I/home/andrew/opencv/opencv-4.4.0_src/modules/features2d/include
-I/home/andrew/opencv/opencv-4.4.0_src/modules/imgcodecs/include
...
-I/home/andrew/opencv/opencv_build/
What I got is:
iw_image_transform_mirror.c:(.text.llwiMirror+0x336): undefined reference to `ippicviMirror_16u_C4R'
What is weird, missing symbol is a part of linked in library ippiw.
So the question is: what is wrong here?
unrelated to the error, but your include paths should not point into the src or build dir, those might be gone later.
rather use
-I/usr/local/include/opencv4
also-L/usr/local/lib
and-L/usr/local/lib/opencv4/3rdparty/
(if this does not work, you probably forgot to run a proper
make install
)Yes, that was my undoubtedly fault. I've fixed it, but error is still the same. I have even tried with
pkg-config --clags --libs
but it also has problems.