交叉编译opencv:undefined reference to `png_riffle_palette_neon

  • 错误
usr/lib/gcc-cross/aarch64-linux-gnu/8/../../../../aarch64-linux-gnu/bin/ld: ../../lib/libopencv_imgcodecs.so.4.2.0: undefined reference to `png_riffle_palette_neon'
collect2: error: ld returned 1 exit status
make[2]: *** [apps/annotation/CMakeFiles/opencv_annotation.dir/build.make:89:bin/opencv_annotation] 错误 1
make[1]: *** [CMakeFiles/Makefile2:3746:apps/annotation/CMakeFiles/opencv_annotation.dir/all] 错误 2
  • 解决办法

方法一:无效
进入到3rdparty/libpng,在CMakeLists.txt顶端增加:

set(ENABLE_NEON ON)

方法二:有效
${HOME}/opencv-3.3.1/3rdparty/libpng/pngpriv.h

/*# if (defined(ARM_NEON) || defined(__ARM_NEON)) && */

if defined(PNG_ARM_NEON) && (defined(ARM_NEON) || defined(__ARM_NEON)) && \

把上面的一行注释掉,增加下面一行。再次make即可。

发布了2601 篇原创文章 · 获赞 324 · 访问量 196万+

猜你喜欢

转载自blog.csdn.net/quantum7/article/details/105091677
今日推荐