Opencv4: Undefined reference to ippiw library symbols

asked 2020-09-09 15:17:42 -0600

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?

edit retag flag offensive close merge delete

Comments

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)

berak gravatar imageberak ( 2020-09-10 01:59:52 -0600 )edit

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.

AndrewSweter gravatar imageAndrewSweter ( 2020-09-10 14:05:37 -0600 )edit