普通网友 2023-10-25 20:41 采纳率: 0%
浏览 30
已结题

make 进行到openCV时出错

专家您好,我想问下在编译一个openwrt这种系统的时候
make到这里出了错,就动不了了
请问是什么原因呢,有没有什么可以努力的解决方向呢?
感谢!


ninja: Entering directory `/home/tu/openwrtproj/openwrt/build_dir/target-i386_pentium4_musl/opencv-3.0.0'
[1/439] Building CXX object 3rdparty/openexr/CMakeFiles/IlmImf.dir/IlmImf/ImfAcesFile.cpp.o
FAILED: 3rdparty/openexr/CMakeFiles/IlmImf.dir/IlmImf/ImfAcesFile.cpp.o 
/home/tu/openwrtproj/openwrt/staging_dir/toolchain-i386_pentium4_gcc-12.3.0_musl/bin/i486-openwrt-linux-musl-g++  -I/home/tu/openwrtproj/openwrt/build_dir/target-i386_pentium4_musl/opencv-3.0.0/3rdparty/openexr/IlmImf -I/home/tu/openwrtproj/openwrt/build_dir/target-i386_pentium4_musl/opencv-3.0.0/3rdparty/openexr/Imath -I/home/tu/openwrtproj/openwrt/build_dir/target-i386_pentium4_musl/opencv-3.0.0/3rdparty/openexr/IlmThread -I/home/tu/openwrtproj/openwrt/build_dir/target-i386_pentium4_musl/opencv-3.0.0/3rdparty/openexr/Iex -I/home/tu/openwrtproj/openwrt/build_dir/target-i386_pentium4_musl/opencv-3.0.0/3rdparty/openexr/Half -I/home/tu/openwrtproj/openwrt/build_dir/target-i386_pentium4_musl/opencv-3.0.0/3rdparty/openexr -I/home/tu/openwrtproj/openwrt/build_dir/target-i386_pentium4_musl/opencv-3.0.0 -Os -pipe -march=pentium4 -fno-caller-saves -fno-plt -fhonour-copts -fmacro-prefix-map=/home/tu/openwrtproj/openwrt/build_dir/target-i386_pentium4_musl/opencv-3.0.0=opencv-3.0.0 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro   -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security  -Wmissing-prototypes -Wstrict-prototypes  -Winit-self -Wpointer-arith  -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -fdiagnostics-show-option -pthread -march=i686 -fomit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -mfpmath=sse -ffunction-sections -fvisibility=hidden -fvisibility-inlines-hidden -Wno-shadow -Wno-unused -Wno-sign-compare -Wno-undef -Wno-missing-declarations -Wno-uninitialized -Wno-switch -Wno-parentheses -Wno-array-bounds -Wno-extra -fPIC -DNDEBUG  -DNDEBUG -MD -MT 3rdparty/openexr/CMakeFiles/IlmImf.dir/IlmImf/ImfAcesFile.cpp.o -MF 3rdparty/openexr/CMakeFiles/IlmImf.dir/IlmImf/ImfAcesFile.cpp.o.d -o 3rdparty/openexr/CMakeFiles/IlmImf.dir/IlmImf/ImfAcesFile.cpp.o -c /home/tu/openwrtproj/openwrt/build_dir/target-i386_pentium4_musl/opencv-3.0.0/3rdparty/openexr/IlmImf/ImfAcesFile.cpp

cc1plus: warning: command-line option '-Wmissing-prototypes' is valid for C/ObjC but not for C++
cc1plus: warning: command-line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++

In file included from /home/tu/openwrtproj/openwrt/build_dir/target-i386_pentium4_musl/opencv-3.0.0/3rdparty/openexr/IlmImf/ImfHeader.h:51,
                 from /home/tu/openwrtproj/openwrt/build_dir/target-i386_pentium4_musl/opencv-3.0.0/3rdparty/openexr/IlmImf/ImfAcesFile.h:80,
                 from /home/tu/openwrtproj/openwrt/build_dir/target-i386_pentium4_musl/opencv-3.0.0/3rdparty/openexr/IlmImf/ImfAcesFile.cpp:41:
/home/tu/openwrtproj/openwrt/build_dir/target-i386_pentium4_musl/opencv-3.0.0/3rdparty/openexr/Imath/ImathVec.h:227:41: error: ISO C++17 does not allow dynamic exception specifications
  227 |     const Vec2 &        normalizeExc () throw (Iex::MathExc);
      |                                         ^~~~~
/home/tu/openwrtproj/openwrt/build_dir/target-i386_pentium4_musl/opencv-3.0.0/3rdparty/openexr/Imath/ImathVec.h:231:48: error: ISO C++17 does not allow dynamic exception specifications
  231 |     Vec2<T>             normalizedExc () const throw (Iex::MathExc);
      |                                                ^~~~~
/home/tu/openwrtproj/openwrt/build_dir/target-i386_pentium4_musl/opencv-3.0.0/3rdparty/openexr/Imath/ImathVec.h:439:41: error: ISO C++17 does not allow dynamic exception specifications
  439 |     const Vec3 &        normalizeExc () throw (Iex::MathExc);
      |                                         ^~~~~
/home/tu/openwrtproj/openwrt/build_dir/target-i386_pentium4_musl/opencv-3.0.0/3rdparty/openexr/Imath/ImathVec.h:443:48: error: ISO C++17 does not allow dynamic exception specifications
  443 |     Vec3<T>             normalizedExc () const throw (Iex::MathExc);
      |                                                ^~~~~
/home/tu/openwrtproj/openwrt/build_dir/target-i386_pentium4_musl/opencv-3.0.0/3rdparty/openexr/Imath/ImathVec.h:621:37: error: ISO C++17 does not allow dynamic exception specifications
  621 |     const Vec4 &    normalizeExc () throw (Iex::MathExc);
      |                                     ^~~~~
/home/tu/openwrtproj/openwrt/build_dir/target-i386_pentium4_musl/opencv-3.0.0/3rdparty/openexr/Imath/ImathVec.h:625:44: error: ISO C++17 does not allow dynamic exception specifications
  625 |     Vec4<T>         normalizedExc () const throw (Iex::MathExc);
      |                                            ^~~~~
/home/tu/openwrtproj/openwrt/build_dir/target-i386_pentium4_musl/opencv-3.0.0/3rdparty/openexr/Imath/ImathVec.h:713:30: error: ISO C++17 does not allow dynamic exception specifications
  713 | Vec2<short>::normalizeExc () throw (Iex::MathExc);
      |                              ^~~~~
/home/tu/openwrtproj/openwrt/build_dir/target-i386_pentium4_musl/opencv-3.0.0/3rdparty/openexr/Imath/ImathVec.h:722:37: error: ISO C++17 does not allow dynamic exception specifications
  722 | Vec2<short>::normalizedExc () const throw (Iex::MathExc);
      |                                     ^~~~~
/home/tu/openwrtproj/openwrt/build_dir/target-i386_pentium4_musl/opencv-3.0.0/3rdparty/openexr/Imath/ImathVec.h:737:28: error: ISO C++17 does not allow dynamic exception specifications
  737 | Vec2<int>::normalizeExc () throw (Iex::MathExc);
。。。。。。。。。。。。。。。。。。。。。

然后下面就是一大堆这种error: ISO C++17 does not allow dynamic exception specifications。请问这段报错的重点在哪里?

  • 写回答

21条回答 默认 最新

  • 专家-赤兔[在线] 全栈领域优质创作者 2023-10-25 20:41
    关注
    获得0.45元问题酬金

    引自强大而免费的微信小程序:皆我百晓生

    这段报错的重点在于"ISO C++17 does not allow dynamic exception specifications",即ISO C++17标准不允许使用动态异常规格说明。在最新的C++标准中,已经不再建议使用动态异常规格说明,因此编译器会发出警告或错误。

    解决这个问题的方法是修改配置文件,将编译选项中的动态异常规格说明去除。具体步骤如下:

    1. 找到OpenCV的CMakeLists.txt文件,在该文件中搜索关键字“-Wmissing-prototypes”和“-Wstrict-prototypes”。

    2. 将相关的编译选项从CMakeLists.txt文件中删除。

    3. 重新运行make命令进行编译,看是否能够成功。

    如果以上方法无效,可能需要检查OpenCV版本与编译环境的兼容性,以及确认是否有其他依赖项缺失或版本不匹配。你可以查看OpenCV的官方文档或社区支持论坛以获取更多技术支持和建议。

    评论 编辑记录

报告相同问题?

问题事件

  • 系统已结题 11月2日
  • 创建了问题 10月25日

悬赏问题

  • ¥50 vue组件中无法正确接收并处理axios请求
  • ¥15 隐藏系统界面pdf的打印、下载按钮
  • ¥15 MATLAB联合adams仿真卡死如何解决(代码模型无问题)
  • ¥15 基于pso参数优化的LightGBM分类模型
  • ¥15 安装Paddleocr时报错无法解决
  • ¥15 python中transformers可以正常下载,但是没有办法使用pipeline
  • ¥50 分布式追踪trace异常问题
  • ¥15 人在外地出差,速帮一点点
  • ¥15 如何使用canvas在图片上进行如下的标注,以下代码不起作用,如何修改
  • ¥50 vue router 动态路由问题