OpenEdv-开源电子网

 找回密码
 立即注册
正点原子全套STM32/Linux/FPGA开发资料,上千讲STM32视频教程免费下载...
查看: 2232|回复: 1

opencv移植时候出现的问题,make后出错,求大神帮忙看看

[复制链接]

2

主题

4

帖子

0

精华

新手入门

积分
16
金钱
16
注册时间
2019-6-29
在线时间
3 小时
发表于 2020-7-2 15:28:02 | 显示全部楼层 |阅读模式
10金钱
[ 18%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/utils/random_utils.c.obj
cc1: warning: ‘-Werror=’ argument ‘-Werror=non-virtual-dtor’ is not valid for C
[ 18%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/utils/rescaler_utils.c.obj
cc1: warning: ‘-Werror=’ argument ‘-Werror=non-virtual-dtor’ is not valid for C
[ 18%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/utils/quant_levels_utils.c.obj
cc1: warning: ‘-Werror=’ argument ‘-Werror=non-virtual-dtor’ is not valid for C
[ 18%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/utils/bit_writer_utils.c.obj
cc1: warning: ‘-Werror=’ argument ‘-Werror=non-virtual-dtor’ is not valid for C
[ 18%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/utils/huffman_encode_utils.c.obj
cc1: warning: ‘-Werror=’ argument ‘-Werror=non-virtual-dtor’ is not valid for C
[ 18%] Building C object 3rdparty/libjasper/CMakeFiles/libjasper.dir/jas_tmr.c.obj
cc1: warning: ‘-Werror=’ argument ‘-Werror=non-virtual-dtor’ is not valid for C
[ 18%] Building C object 3rdparty/libjasper/CMakeFiles/libjasper.dir/jpc_t1dec.c.obj
cc1: warning: ‘-Werror=’ argument ‘-Werror=non-virtual-dtor’ is not valid for C
[ 18%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/utils/huffman_utils.c.obj
cc1: warning: ‘-Werror=’ argument ‘-Werror=non-virtual-dtor’ is not valid for C
[ 19%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/utils/color_cache_utils.c.obj
cc1: warning: ‘-Werror=’ argument ‘-Werror=non-virtual-dtor’ is not valid for C
[ 19%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/utils/thread_utils.c.obj
cc1: warning: ‘-Werror=’ argument ‘-Werror=non-virtual-dtor’ is not valid for C
[ 19%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/utils/filters_utils.c.obj
cc1: warning: ‘-Werror=’ argument ‘-Werror=non-virtual-dtor’ is not valid for C
[ 19%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/utils/bit_reader_utils.c.obj
cc1: warning: ‘-Werror=’ argument ‘-Werror=non-virtual-dtor’ is not valid for C
[ 19%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/utils/utils.c.obj
cc1: warning: ‘-Werror=’ argument ‘-Werror=non-virtual-dtor’ is not valid for C
[ 19%] Building C object 3rdparty/libwebp/CMakeFiles/libwebp.dir/src/utils/quant_levels_dec_utils.c.obj
cc1: warning: ‘-Werror=’ argument ‘-Werror=non-virtual-dtor’ is not valid for C
[ 19%] Linking C static library ../lib/liblibwebp.a
[ 19%] Built target libwebp
Scanning dependencies of target libpng
[ 19%] Building C object 3rdparty/libjasper/CMakeFiles/libjasper.dir/jas_string.c.obj
cc1: warning: ‘-Werror=’ argument ‘-Werror=non-virtual-dtor’ is not valid for C
[ 19%] Building C object 3rdparty/libjasper/CMakeFiles/libjasper.dir/jpc_mqcod.c.obj
[ 19%] Building C object 3rdparty/libpng/CMakeFiles/libpng.dir/png.c.obj
cc1: warning: ‘-Werror=’ argument ‘-Werror=non-virtual-dtor’ is not valid for C
cc1: warning: ‘-Werror=’ argument ‘-Werror=non-virtual-dtor’ is not valid for C
[ 19%] Building C object 3rdparty/libjasper/CMakeFiles/libjasper.dir/jpc_cs.c.obj
cc1: warning: ‘-Werror=’ argument ‘-Werror=non-virtual-dtor’ is not valid for C
In file included from /home/jdc/opencv/opencv-3.4.1/3rdparty/libpng/pngpriv.h:904:0,
                 from /home/jdc/opencv/opencv-3.4.1/3rdparty/libpng/png.c:14:
/home/jdc/opencv/opencv-3.4.1/3rdparty/libpng/pngstruct.h:30:10: fatal error: zlib.h: 没有那个文件或目录
#include "zlib.h"
          ^~~~~~~~
compilation terminated.
3rdparty/libpng/CMakeFiles/libpng.dir/build.make:62: recipe for target '3rdparty/libpng/CMakeFiles/libpng.dir/png.c.obj' failed
make[2]: *** [3rdparty/libpng/CMakeFiles/libpng.dir/png.c.obj] Error 1
CMakeFiles/Makefile2:601: recipe for target '3rdparty/libpng/CMakeFiles/libpng.dir/all' failed
make[1]: *** [3rdparty/libpng/CMakeFiles/libpng.dir/all] Error 2
make[1]: *** 正在等待未完成的任务....
[ 19%] Linking C static library ../lib/liblibjasper.a
[ 19%] Built target libjasper
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2


捕获.PNG

最佳答案

查看完整内容[请看2#楼]

源码的CMakeLists.txt中(~/opencv-3.4.1/CMakeLists.txt),在514行增加以上代码: ocv_include_directories(./3rdparty/zlib/) 如下: ...... ocv_include_directories(${OPENCV_CONFIG_FILE_INCLUDE_DIR}) ocv_include_directories(./3rdparty/zlib/) ...... (csdn上找到的可以解决的方法,亲测ok)
正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

2

主题

4

帖子

0

精华

新手入门

积分
16
金钱
16
注册时间
2019-6-29
在线时间
3 小时
 楼主| 发表于 2020-7-2 15:28:03 | 显示全部楼层
源码的CMakeLists.txt中(~/opencv-3.4.1/CMakeLists.txt),在514行增加以上代码: ocv_include_directories(./3rdparty/zlib/)

如下:
......
ocv_include_directories(${OPENCV_CONFIG_FILE_INCLUDE_DIR})
ocv_include_directories(./3rdparty/zlib/)
......

(csdn上找到的可以解决的方法,亲测ok)
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则



关闭

原子哥极力推荐上一条 /2 下一条

正点原子公众号

QQ|手机版|OpenEdv-开源电子网 ( 粤ICP备12000418号-1 )

GMT+8, 2024-11-25 14:32

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

快速回复 返回顶部 返回列表