Ask Your Question

Revision history [back]

I have tried for both, but the same error appears as following...

[ 30%] Linking CXX shared library ../../lib/libopencv_videoio.so /usr/bin/ld: /usr/local/lib/libavcodec.a(avpacket.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/local/lib/libavcodec.a: error adding symbols: Bad value collect2: error: ld returned 1 exit status modules/videoio/CMakeFiles/opencv_videoio.dir/build.make:310: recipe for target 'lib/libopencv_videoio.so.3.1.0' failed make[2]: *** [lib/libopencv_videoio.so.3.1.0] Error 1 CMakeFiles/Makefile2:4301: recipe for target 'modules/videoio/CMakeFiles/opencv_videoio.dir/all' failed make[1]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... [ 30%] Linking CXX shared library ../../lib/libopencv_shape.so [ 30%] Built target opencv_shape [ 30%] Linking CXX shared library ../../lib/libopencv_photo.so [ 30%] Built target opencv_photo Makefile:160: recipe for target 'all' failed make: *** [all] Error 2