1
votes

I'm trying to compile a program for windows on linux using OpenCV. I've followed this guide: http://www.blogcompiler.com/2010/07/11/compile-for-windows-on-linux/ .

I only installed everything I need for the 64 bit architecture. Everything works as it should before I try anything with OpenCV, I already have opencv installed in the usr/include directory and it works fine with the gcc. So I copied the opencv files from the usr/inlcude directory into the /opt/mingw64/W64_180676/mingw/include directory and it recognizes it, but when I try to compile it gives me this error:

/usr/lib/libopencv_calib3d.so: could not read symbols: File in wrong format

I have read that this error is something to do with mismatched architectures, but seeing as everything I have installed is for 64 bit, this confuses me. If anyone can help me it would be greatly appreciated.

Thanks, Dave

1

1 Answers

1
votes

It is not that easy. You need to cross-compile OpenCV for Windows first and for this you need to have cross-compiled dependencies of OpenCV.

The architecture may be the same, but the symbols generated by different compilers differ (eg. gcc binary != mingw binary).