Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I fixed it

My build command was missing the --static flag.

g++ TestApp.cpp -o TestApp `pkg-config --cflags --static --libs opencv4`

Now it can build my test application with OpenCV3.2.0 with no problems but I get this error when i use OpenCV4.1.0.

/usr/bin/ld: cannot find -lgflags_shared

I dont think I need this lib so i fixed this by removing -lgflags_shared from the opencv.pc file. Doing it manually works but using the command line is more convenient.

sed -i 's/-lgflags_shared //g' unix-install/opencv4.pc