OpenCV project from Linux to .exe
-
Hey qt forum users,
alright, I am definitely lost here.
I have a program I wrote on my Linux version of qt that needs the OpenCV libraries. My goal is to get this program to work on Windows, as an .exe.
First realizing that this might get complicated, I tried to follow the instructions in the OpenCV cookbook (http://www.laganiere.name/opencvCookbook/chap1s1_2.shtml). It seemed to do everything fine (which was some piece of work in itself), but when building a project, it does not recognize the opencv .dll's. I have tried a whole lot of things, including:
-
renaming the links in the .pro file from '-libopencv_...' to 'libopencv_...'. This seems to accept the named .dlls (no more errors concerning the specified .dlls), but it now wants to have the 'lopencv_...' dlls as well which are, as far as I know, old versions from OpenCV1, which are ones I do not and I think should not use. They should not be required.
-
putting the mentioned .dlls in every possible folder so that the program does not need the link. Same results
-
running cmake again, because the path to the .dlls was not exactly the same as in the Cookbook. No wonders though since it adresses an old version of Qt and OpenCV.
I read that it should be possible to somehow cross-compile the code on Linux for Windows, but that did not work either.
Versions: Qt 5.5, installed with MinGW, OpenCV 2.4.12, Windows 7 x64.
I hope someone has a hint as to what I can do to make Qt recognize the OpenCV libraries.
Edwin
-
-
@Edwin I don't think it is possible to crosscompile from Linux to Windows.
However, you can have your Qt application running with OpenCV on Linux.
Then from the very same source (considering you define properly the include path and libs according to the OS in the .pro file) be able to compile it (and hopefully) run it from Windows. -
If QtCreator is not necessary I recommend
- VS2013 https://www.visualstudio.com/en-us/news/vs2013-community-vs.aspx
- QtPlugin http://download.qt.io/official_releases/vsaddin/qt-vs-addin-1.2.4-opensource.exe.mirrorlist
- Ceemple's OpenCV http://www.ceemple.com/ceemple-opencv-visual-studio/
Thats how i got it (i mean OCV+Qt) working @ windows
-
Hi,
Just a quick note, yes you can cross-compile from Linux to Windows using the MinGW cross-compiler, provided that you don't use anything Windows specific and that you also cross-compiled the dependencies of your application.
-
Use the "Topic Tool" button :)