3
  • OpenCV => 3.3.0
    • Operating System / Platform => raspberry pi 3 model B(debian)
    • Compiler => UNIX Makefiles
    • Cmake-GUI => 3.6.2

https://pastebin.com/5VGHA92m (build output from terminal)

[ 39%] 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:228: recipe for target 'lib/libopencv_videoio.so.3.3.0' failed make[2]: * [lib/libopencv_videoio.so.3.3.0] Error 1 CMakeFiles/Makefile2:4311: 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

using opencv=3.3.0 opencv_contrib=3.3.0

before building I Unchecked: BUILD_opencv_world, BUILD_TBB, WITH_TBB, BUILD_opencv_python2, BUILD_opencv_python3, WITH_MATLAB, WITH_CUDA, BUILD_opencv_dnn, WITH_OPENGL, WITH_QT

and Checked: WITH_FFMPEG(Default)

I installed all libraries (mentioned in below link) https://pastebin.com/vFkYzQ08 (prerequisite libraries before building)

I also tried remove all those libraries and building opencv source with ffmpeg and contrib (yet build crashes at 23% for opencv 3.4 and 39% for opencv 3.3)

1 Answers1

1

Looks like there is some conflict with x264 library (you can install it later once you are done with OpenCV build), remove that library then install gstreamer

sudo apt-get install gstreamer1.0

Install dependencies from
https://www.pyimagesearch.com/2017/09/04/raspbian-stretch-install-opencv-3-python-on-your-raspberry-pi/

and

https://www.raspberrypi.org/forums/viewtopic.php?t=80601

Below is output from CMake

General configuration for OpenCV 3.4.0-dev
=====================================
Version control: 3.4.0-307-g14089b1

Platform:
Timestamp: 2018-02-06T06:30:15Z
Host: Linux 4.9.35-v7+ armv7l
CMake: 3.6.2
CMake generator: Unix Makefiles
CMake build tool: /usr/bin/make
Configuration: Release

CPU/HW features:
Baseline:
requested: DETECT
disabled: VFPV3 NEON

C/C++:
Built as dynamic libs?: YES
C++ Compiler: /usr/bin/c++ (ver 4.9.2)
C++ flags (Release):

-fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -mfp16-format=ieee -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUG

C++ flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -mfp16-format=ieee -fvisibility=hidden -fvisibility-inlines-hidden -g -O0 -DDEBUG -D_DEBUG

C Compiler: /usr/bin/cc
C flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-narrowing -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -mfp16-format=ieee -fvisibility=hidden -O3 -DNDEBUG -DNDEBUG

C flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-narrowing -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -mfp16-format=ieee -fvisibility=hidden -g -O0 -DDEBUG -D_DEBUG

Linker flags (Release):
Linker flags (Debug):
ccache: NO
Precompiled headers: YES
Extra dependencies: dl m pthread rt
3rdparty dependencies:


OpenCV modules:
To be built: calib3d core features2d flann highgui
imgcodecs imgproc ml objdetect photo shape stitching superres ts video
videoio videostab
Disabled: dnn java_bindings_generator js
python_bindings_generator world
Disabled by dependency: -
Unavailable: cudaarithm cudabgsegm cudacodec
cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect
cudaoptflow cudastereo cudawarping cudev java python2 python3 viz
Applications: tests perf_tests apps
Documentation: NO
Non-free algorithms: NO

GUI:
GTK+: YES (ver 3.14.5)
GThread : YES (ver 2.42.1)
GtkGlExt: NO
VTK support: NO

Media I/O:
ZLib: /usr/lib/arm-linux-gnueabihf/libz.so (ver 1.2.8)
JPEG: /usr/lib/arm-linux-gnueabihf/libjpeg.so (ver 80)
WEBP: build (ver encoder: 0x020e)
PNG: /usr/lib/arm-linux-gnueabihf/libpng.so (ver 1.2.50)
TIFF: build (ver 42 - 4.0.9)
JPEG 2000: /usr/lib/arm-linux-gnueabihf/libjasper.so (ver 1.900.1)
OpenEXR: build (ver 1.7.1)

Video I/O:
DC1394: NO
FFMPEG: YES
avcodec: YES (ver 56.1.0)
avformat: YES (ver 56.1.0)
avutil: YES (ver 54.3.0)
swscale: YES (ver 3.0.0)
avresample: YES (ver 2.1.0)
GStreamer:
base: YES (ver 1.4.4)
video: YES (ver 1.4.4)
app: YES (ver 1.4.4)
riff: YES (ver 1.4.4)
pbutils: YES (ver 1.4.4)
libv4l/libv4l2: NO
v4l/v4l2: linux/videodev2.h
gPhoto2: NO

Parallel framework: pthreads

Trace: YES (built-in)

Other third-party libraries:
Lapack: NO
Eigen: NO
Custom HAL: YES (carotene (ver 0.0.1))
Protobuf: build (3.5.1)

OpenCL: YES (no extra features)
Include path: /home/pi/OpenCV/Source/opencv/3rdparty/include/opencl/1.2
Link libraries: Dynamic load

Python (for build):

Install to:
/usr/local
-----------------------------------------------------------------

Configuring done