Ask Your Question

Revision history [back]

Can't compile OpenCV 3.2.0 on Respberry 2

Hey there guys,

I can't compile the 3.2.0 version on a Respberry 2. I have used the script here:

https://gist.github.com/willprice/c216fcbeba8d14ad1138

and adjusted the open_modules bug on that script.

But I still get the following error:

[ 48%] Built target opencv_shape
[ 49%] Built target opencv_imgcodecs
[ 49%] Linking CXX shared library ../../lib/libopencv_videoio.so
/usr/bin/ld: /usr/local/lib/libx264.a(common.o): relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libx264.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
modules/videoio/CMakeFiles/opencv_videoio.dir/build.make:254: recipe for target 'lib/libopencv_videoio.so.3.2.0' failed
make[2]: *** [lib/libopencv_videoio.so.3.2.0] Error 1
CMakeFiles/Makefile2:5596: recipe for target 'modules/videoio/CMakeFiles/opencv_videoio.dir/all' failed
make[1]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2
Installing OpenCV...
[  3%] Built target libwebp
[  8%] Built target IlmImf
[ 11%] Built target carotene_objs
[ 12%] Built target tegra_hal
[ 12%] Built target opencv_core_pch_dephelp
[ 13%] Built target pch_Generate_opencv_core
[ 16%] Built target opencv_core
[ 17%] Built target opencv_ts_pch_dephelp
[ 17%] Built target pch_Generate_opencv_ts
[ 17%] Built target opencv_imgproc_pch_dephelp
[ 17%] Built target pch_Generate_opencv_imgproc
[ 21%] Built target opencv_imgproc
[ 21%] Built target opencv_imgcodecs_pch_dephelp
[ 21%] Built target pch_Generate_opencv_imgcodecs
[ 22%] Built target opencv_imgcodecs
[ 22%] Built target opencv_videoio_pch_dephelp
[ 22%] Built target pch_Generate_opencv_videoio
[ 22%] Linking CXX shared library ../../lib/libopencv_videoio.so
/usr/bin/ld: /usr/local/lib/libx264.a(common.o): relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libx264.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
modules/videoio/CMakeFiles/opencv_videoio.dir/build.make:254: recipe for target 'lib/libopencv_videoio.so.3.2.0' failed
make[2]: *** [lib/libopencv_videoio.so.3.2.0] Error 1
CMakeFiles/Makefile2:5596: recipe for target 'modules/videoio/CMakeFiles/opencv_videoio.dir/all' failed
make[1]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2

Somebody on GIthub said that I should disable FFMPEG support for OpenCV.

How can I disable it? And somebody else got an idea?

Thanks mapo