编译错误:
/home/lm/software/all_toolchains/rk-linux/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/8.3.0/../../../../arm-linux-gnueabihf/bin/ld: ../../lib/libopencv_world.so.4.5.4: undefined reference to `png_do_expand_palette_rgb8_neon'
/home/lm/software/all_toolchains/rk-linux/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/8.3.0/../../../../arm-linux-gnueabihf/bin/ld: ../../lib/libopencv_world.so.4.5.4: undefined reference to `png_init_filter_functions_neon'
/home/lm/software/all_toolchains/rk-linux/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/8.3.0/../../../../arm-linux-gnueabihf/bin/ld: ../../lib/libopencv_world.so.4.5.4: undefined reference to `png_do_expand_palette_rgba8_neon'
/home/lm/software/all_toolchains/rk-linux/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/8.3.0/../../../../arm-linux-gnueabihf/bin/ld: ../../lib/libopencv_world.so.4.5.4: undefined reference to `png_riffle_palette_neon'
collect2: 错误: ld 返回 1
make[2]: *** [apps/model-diagnostics/CMakeFiles/opencv_model_diagnostics.dir/build.make:98:bin/opencv_model_diagnostics] 错误 1
make[1]: *** [CMakeFiles/Makefile2:1506:apps/model-diagnostics/CMakeFiles/opencv_model_diagnostics.dir/all] 错误 2
make[1]: *** 正在等待未完成的任务....
[100%] Building CXX object apps/interactive-calibration/CMakeFiles/opencv_interactive-calibration.dir/rotationConverters.cpp.o
[100%] Linking CXX executable ../../bin/opencv_version
/home/lm/software/all_toolchains/rk-linux/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/8.3.0/../../../../arm-linux-gnueabihf/bin/ld: ../../lib/libopencv_world.so.4.5.4: undefined reference to `png_do_expand_palette_rgb8_neon'
/home/lm/software/all_toolchains/rk-linux/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/8.3.0/../../../../arm-linux-gnueabihf/bin/ld: ../../lib/libopencv_world.so.4.5.4: undefined reference to `png_init_filter_functions_neon'
/home/lm/software/all_toolchains/rk-linux/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/8.3.0/../../../../arm-linux-gnueabihf/bin/ld: ../../lib/libopencv_world.so.4.5.4: undefined reference to `png_do_expand_palette_rgba8_neon'
/home/lm/software/all_toolchains/rk-linux/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/8.3.0/../../../../arm-linux-gnueabihf/bin/ld: ../../lib/libopencv_world.so.4.5.4: undefined reference to `png_riffle_palette_neon'
collect2: 错误: ld 返回 1
make[2]: *** [apps/version/CMakeFiles/opencv_version.dir/build.make:98:bin/opencv_version] 错误 1
make[1]: *** [CMakeFiles/Makefile2:1480:apps/version/CMakeFiles/opencv_version.dir/all] 错误 2
[100%] Linking CXX executable ../../bin/opencv_annotation
/home/lm/software/all_toolchains/rk-linux/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/8.3.0/../../../../arm-linux-gnueabihf/bin/ld: ../../lib/libopencv_world.so.4.5.4: undefined reference to `png_do_expand_palette_rgb8_neon'
/home/lm/software/all_toolchains/rk-linux/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/8.3.0/../../../../arm-linux-gnueabihf/bin/ld: ../../lib/libopencv_world.so.4.5.4: undefined reference to `png_init_filter_functions_neon'
/home/lm/software/all_toolchains/rk-linux/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/8.3.0/../../../../arm-linux-gnueabihf/bin/ld: ../../lib/libopencv_world.so.4.5.4: undefined reference to `png_do_expand_palette_rgba8_neon'
/home/lm/software/all_toolchains/rk-linux/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/8.3.0/../../../../arm-linux-gnueabihf/bin/ld: ../../lib/libopencv_world.so.4.5.4: undefined reference to `png_riffle_palette_neon'
collect2: 错误: ld 返回 1
make[2]: *** [apps/annotation/CMakeFiles/opencv_annotation.dir/build.make:98:bin/opencv_annotation] 错误 1
make[1]: *** [CMakeFiles/Makefile2:1402:apps/annotation/CMakeFiles/opencv_annotation.dir/all] 错误 2
[100%] Linking CXX executable ../../bin/opencv_visualisation
/home/lm/software/all_toolchains/rk-linux/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/8.3.0/../../../../arm-linux-gnueabihf/bin/ld: ../../lib/libopencv_world.so.4.5.4: undefined reference to `png_do_expand_palette_rgb8_neon'
/home/lm/software/all_toolchains/rk-linux/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/8.3.0/../../../../arm-linux-gnueabihf/bin/ld: ../../lib/libopencv_world.so.4.5.4: undefined reference to `png_init_filter_functions_neon'
/home/lm/software/all_toolchains/rk-linux/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/8.3.0/../../../../arm-linux-gnueabihf/bin/ld: ../../lib/libopencv_world.so.4.5.4: undefined reference to `png_do_expand_palette_rgba8_neon'
/home/lm/software/all_toolchains/rk-linux/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/8.3.0/../../../../arm-linux-gnueabihf/bin/ld: ../../lib/libopencv_world.so.4.5.4: undefined reference to `png_riffle_palette_neon'
collect2: 错误: ld 返回 1
make[2]: *** [apps/visualisation/CMakeFiles/opencv_visualisation.dir/build.make:98:bin/opencv_visualisation] 错误 1
make[1]: *** [CMakeFiles/Makefile2:1428:apps/visualisation/CMakeFiles/opencv_visualisation.dir/all] 错误 2
[100%] Linking CXX executable ../../bin/opencv_interactive-calibration
/home/lm/software/all_toolchains/rk-linux/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/8.3.0/../../../../arm-linux-gnueabihf/bin/ld: ../../lib/libopencv_world.so.4.5.4: undefined reference to `png_do_expand_palette_rgb8_neon'
/home/lm/software/all_toolchains/rk-linux/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/8.3.0/../../../../arm-linux-gnueabihf/bin/ld: ../../lib/libopencv_world.so.4.5.4: undefined reference to `png_init_filter_functions_neon'
/home/lm/software/all_toolchains/rk-linux/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/8.3.0/../../../../arm-linux-gnueabihf/bin/ld: ../../lib/libopencv_world.so.4.5.4: undefined reference to `png_do_expand_palette_rgba8_neon'
/home/lm/software/all_toolchains/rk-linux/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/8.3.0/../../../../arm-linux-gnueabihf/bin/ld: ../../lib/libopencv_world.so.4.5.4: undefined reference to `png_riffle_palette_neon'
collect2: 错误: ld 返回 1
make[2]: *** [apps/interactive-calibration/CMakeFiles/opencv_interactive-calibration.dir/build.make:178:bin/opencv_interactive-calibration] 错误 1
make[1]: *** [CMakeFiles/Makefile2:1454:apps/interactive-calibration/CMakeFiles/opencv_interactive-calibration.dir/all] 错误 2
make: *** [Makefile:166:all] 错误 2
libopencv_world.so.4.5.4
依赖了以下几个符号:
png_do_expand_palette_rgb8_neon
png_init_filter_functions_neon
png_do_expand_palette_rgba8_neon
png_riffle_palette_neon
解决:
打开opencv源码目录,编辑文件 vim 3rdparty/libpng/pngpriv.h
第130行注释掉, 修改为131行