Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Can not link c++ app with opencv 3.1.1 only in Ubuntu

System information (version) Opencv install from source follow this instruction https://opencv-java-tutorials.readthedocs.io/en/latest/01-installing-opencv-for-java.html#install-opencv-3-x-under-linux

$ pkg-config --modversion opencv 3.3.1 $ uname -r 4.15.13-041513-generic Ubuntu 16.04 $ g++ --version g++ (Ubuntu 7.3.0-16ubuntu3) 7.3.0 Copyright (C) 2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Detailed description Opencv build ok Java application can load opencv library and work ok. But c++ app link error $g++ -std=c++11 -ggdb pkg-config --cflags opencv decode.cpp -o decode -ldl pkg-config --libs opencv /usr/bin/x86_64-linux-gnu-ld: /usr/local/lib/libopencv_core.a(opencl_core.cpp.o): undefined reference to symbol 'dlclose@@GLIBC_2.2.5' /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libdl.so: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status

Steps to reproduce Compile demo code. Code compile and work well on os x, but error linking in Ubuntu https://github.com/hitanshu-dhawan/ImageSteganography/blob/master/encode.cpp