centos平台上交叉编译arm版本opencv

编译工具

cmake-3.22.1

gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf

1.zlib

no

命令

1

cd zlib-1.2.8

2

CC=arm-linux-gnueabihf-gcc ./configure --prefix=/home/hisense/opencvDepend/3dmake --shared

2.libjpeg

1

./configure --prefix=/home/hisense/opencvDepend/3dmake --enable-shared --enable-static CC=arm-linux-gnueabihf-gcc --host=arm-linux

3.安装libx264

1

CC=arm-linux-gnueabihf-gcc ./configure --host=arm-linux --prefix=/home/hisense/opencvDepend/3dmake --enable-shared --disable-asm

4.libxvid

1

cd build/generic

2

./configure --host=arm-linux-gnueabihf --prefix=/home/hisense/opencvDepend/3dmake --disable-assembly

5.安装libyasm

1

CC=arm-linux-gnueabihf-gcc ./configure --host=arm-linux --prefix=/home/hisense/opencvDepend/3dmake --enable-shared --disable-asm


6.交叉编译libpng

在linux上交叉编译opencv之前需要交叉编译的依赖库 - 简书

pngstruct.h:30:10: fatal error: zlib.h: 没有那个文件或目录

路径拼写错误

undefined reference to `png_init_filter_functions_neon'

undefined reference to `png_init_filter_functions_neon'_singing1001的博客-CSDN博客

7.ffmpeg

1

./configure --prefix=/home/hisense/opencvDepend/3dmake --enable-shared --disable-static --enable-gpl --enable-cross-compile --arch=arm --disable-stripping --target-os=linux --enable-libx264 --enable-libxvid --cc=arm-linux-gnueabihf-gcc --enable-swscale --extra-ldflags=-L/home/hisense/opencvDepend/3dmake/lib --extra-cflags=-I/home/hisense/opencvDepend/3dmake/include

--enable-avresample

8.Libffi

1

CC=arm-linux-gnueabihf-gcc ./configure --prefix=/home/hisense/opencvDepend/3dmake --host=arm-linux

9.glib

1

./configure --prefix=/home/hisense/opencvDepend/3dmake 

CC=arm-linux-gnueabihf-gcc  LIBFFI_CFLAGS="/home/hisense/opencvDepend/3dmake/lib/libffi-3.2.1/include" \

LIBFFI_LIBS="-lffi-L/home/hisense/opencvDepend/3dmake/lib" ZLIB_CFLAGS="-I/home/hisense/opencvDepend/3dmake/include" \

ZLIB_LIBS="-lz -L/home/hisense/opencvDepend/3dmake/lib" --cache-file=glib.cache \  --disable-selinux  --disable-xattr --disable-libelf

Opencv编译问题列表

1

FFMPEG: NO

cmake-gui通过Add Entry按钮添加 OPENCV_ENABLE_PKG_CONFIG,选bool类型,打勾。

RK1808交叉编译opencv with ffmpeg(解决FFMPEG始终为NO)_jbjhzstsl的博客-CSDN博客_undefined reference to `x264_8_nal_escape_neon

2

undefined reference to 'gzdopen'

3

fatal error: tiff.h: 没有那个文件或目录

 #include "tiff.h

关掉编译选项WITH_TIFF

fatal error: dc1394/dc1394.h: 没有那个文件或目录

 #include

4

在OpenCV的开放的源码里可以清楚的看到:OpenCV做了对1394接口的支持,至少是提供了接口,没有提供可供使用的驱动库;

关掉编译选项WITH_DC1394

5

error: size of array ‘_GStaticAssertCompileTimeAssertion_0’ is negative

   G_STATIC_ASSERT(sizeof (unsigned long long) == sizeof (guint64));

关掉编译选项 WITH_GStreamer

参考博客

交叉编译OpenCV3.3 - iTop4412平台_xiaokang_rays的博客-CSDN博客  (重要)

RK1808交叉编译opencv with ffmpeg(解决FFMPEG始终为NO)_jbjhzstsl的博客-CSDN博客_undefined reference to `x264_8_nal_escape_neon (重要)

你可能感兴趣的:(Opencv,计算机视觉,机器视觉,linux,arm开发,运维)