使用docker环境arm交叉编译OpenCV出错
-
我用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 }
-
libopencv_highgui.so.4.8.0: file not recognized: File format not recognized
opencv不是交叉编译的
Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号