交叉编译opencv:undefined reference to `png_riffle_palette_neon

简介: 交叉编译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即可。

目录
相关文章
undefined reference to symbol 'dlsym@@GLIBC_2.17' libdl.so: error adding symbols: DSO missing from c
undefined reference to symbol 'dlsym@@GLIBC_2.17' libdl.so: error adding symbols: DSO missing from c
618 0
解决办法:undefined reference to symbol 'shm_open@@GLIBC_2.2.5'
解决办法:undefined reference to symbol 'shm_open@@GLIBC_2.2.5'
398 0
|
Linux C语言 计算机视觉
OpenIN2 Linux 编译OpenCV 报错undefined reference to `xxx@xxx‘
OpenIN2 Linux 编译OpenCV 报错undefined reference to `xxx@xxx‘
342 0
OpenIN2 Linux 编译OpenCV 报错undefined reference to `xxx@xxx‘
|
Ubuntu C语言
【ubuntu】2.c:(.text+0xd2): undefined reference to `pthread_create‘ collect2: error: ld returned
【ubuntu】2.c:(.text+0xd2): undefined reference to `pthread_create‘ collect2: error: ld returned
148 0
undefined reference to `major‘
undefined reference to `major‘
281 0
undefined reference to `gdk_monitor_get_scale_factor/gtk_widget_get_scale_factor‘
undefined reference to `gdk_monitor_get_scale_factor/gtk_widget_get_scale_factor‘
96 0
|
C++
undefined reference to `vtable for XXX‘
undefined reference to `vtable for XXX‘
186 0
NDK编译doubango时出现错误:undefined reference to ‘stderr‘
NDK编译doubango时出现错误:undefined reference to ‘stderr‘
140 0
undefined reference to `crypto_get_random'
undefined reference to `crypto_get_random'
87 0