导航

    全志在线开发者论坛

    • 注册
    • 登录
    • 搜索
    • 版块
    • 话题
    • 在线文档
    • 社区主页

    使用docker环境arm交叉编译OpenCV出错

    其它全志芯片讨论区
    2
    2
    1064
    正在加载更多帖子
    • 从旧到新
    • 从新到旧
    • 最多赞同
    回复
    • 在新帖中回复
    登录后回复
    此主题已被删除。只有拥有主题管理权限的用户可以查看。
    • Y
      giao LV 6 最后由 编辑

      我用V3S的docker环境准备交叉编译一个OpenCV的程序去v3s
      我编译成功helloworld后准备弄OpenCV
      但是很奇怪的事情发生了

      当我的cpp文件还是helloworld原来的样子
      我单独编译arm程序可以编译
      或者单独编译opencv程序也可以正常编译
      当我在cmakelists.txt同时启用arm交叉编译和opencv时候就报错报错如下

      /usr/local/lib/libopencv_highgui.so.4.8.0: file not recognized: File format not recognized
      collect2: error: ld returned 1 exit status
      CMakeFiles/Test2.dir/build.make:109: recipe for target 'Test2' failed
      make[2]: *** [Test2] Error 1
      CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/Test2.dir/all' failed
      make[1]: *** [CMakeFiles/Test2.dir/all] Error 2
      Makefile:83: recipe for target 'all' failed
      make: *** [all] Error 2
      

      当我编译一个正常的opencv程序cmake启用opencv,不启用交叉编译时,他也能编译

      #include <opencv2/highgui/highgui.hpp>
      #include <opencv2/imgproc/imgproc.hpp>
      #include <opencv2/core/core.hpp>
      #include<iostream>
      #include <string>
      #include <sstream>
      using namespace cv;
      using namespace std;
      int main()
      {
      // Capture the Image from the webcam
      VideoCapture cap(0);
      
      // Get the frame
      Mat save_img; cap >> save_img;
      
      if(save_img.empty())
      {
        std::cerr << "Something is wrong with the webcam, could not get frame." << std::endl;
      }
      // Save the frame into a file
      imwrite("test.jpg", save_img); // A JPG FILE IS BEING SAVED
      }
      
      1 条回复 最后回复 回复 引用 分享 0
      • A
        awwwwa LV 8 最后由 编辑

        libopencv_highgui.so.4.8.0: file not recognized: File format not recognized

        opencv不是交叉编译的

        1 条回复 最后回复 回复 引用 分享 0
        • 1 / 1
        • First post
          Last post

        Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号

        行为准则 | 用户协议 | 隐私权政策