Ask Your Question

Revision history [back]

I am Trying to cross compiling OpenCV application statically by using following command

$ cmake -DCMAKE_TOOLCHAIN_FILE=../riscv.toolchain.cmake ../../.. -DWITH_PNG=OF -DBUILD_SHARED_LIBS=OFF -DCMAKE_EXE_LINKER_FLAGS="-static" .

I am getting error as below

../../lib/libopencv_core.a(opencl_core.cpp.o): In function GetHandle(char const*)': opencl_core.cpp:(.text._ZL9GetHandlePKc+0xc): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /usr/bin/ld: attempted static link of dynamic object/usr/local/lib/' collect2: error: ld returned 1 exit status apps/version/CMakeFiles/opencv_version.dir/build.make:96: recipe for target 'bin/opencv_version' failed make[2]: * [bin/opencv_version] Error 1

Please help me regarding this error.

Thanks in advance