Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. OpenCV project from Linux to .exe
QtWS25 Last Chance

OpenCV project from Linux to .exe

Scheduled Pinned Locked Moved Solved General and Desktop
opencvmingwdllbuild error
11 Posts 6 Posters 4.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Edwin
    3 Feb 2016, 17:35

    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

    C Offline
    C Offline
    Charby
    wrote on 3 Feb 2016, 18:25 last edited by
    #2

    @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.

    J 1 Reply Last reply 3 Feb 2016, 18:28
    1
    • C Charby
      3 Feb 2016, 18:25

      @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.

      J Offline
      J Offline
      JohanSolo
      wrote on 3 Feb 2016, 18:28 last edited by JohanSolo 2 Mar 2016, 18:28
      #3

      @Charby said:

      @Edwin I don't think it is possible to crosscompile from Linux to Windows.

      IIRC there's a gvv cross-compiler which produces minwg binaries.

      `They did not know it was impossible, so they did it.'
      -- Mark Twain

      1 Reply Last reply
      1
      • M Offline
        M Offline
        michelson
        wrote on 3 Feb 2016, 18:33 last edited by
        #4

        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
        E 1 Reply Last reply 3 Feb 2016, 20:43
        1
        • M Offline
          M Offline
          mrdebug
          wrote on 3 Feb 2016, 20:34 last edited by
          #5

          Hi. I'm using OpenCV on Windows with Qt MinGW. It was not easy to understand how OpenCV must be compiled and embedded in a Qt project but can.
          I suggest you to not cross compile but to use a Windows machine.

          Need programmers to hire?
          www.labcsp.com
          www.denisgottardello.it
          GMT+1
          Skype: mrdebug

          E 1 Reply Last reply 3 Feb 2016, 20:48
          0
          • M michelson
            3 Feb 2016, 18:33

            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
            E Offline
            E Offline
            Edwin
            wrote on 3 Feb 2016, 20:43 last edited by
            #6

            @michelson Trying all that right now. That is: downloading. I hope this works. I will need some time to adjust to VS though, I suppose...

            Thanks for the reply! (also to the other contributors)

            1 Reply Last reply
            0
            • M mrdebug
              3 Feb 2016, 20:34

              Hi. I'm using OpenCV on Windows with Qt MinGW. It was not easy to understand how OpenCV must be compiled and embedded in a Qt project but can.
              I suggest you to not cross compile but to use a Windows machine.

              E Offline
              E Offline
              Edwin
              wrote on 3 Feb 2016, 20:48 last edited by
              #7

              @mrdebug Hey, that's what I tried (as you may have read), but that fails me and I have no clue as to why.

              1 Reply Last reply
              0
              • M Offline
                M Offline
                michelson
                wrote on 3 Feb 2016, 21:11 last edited by
                #8

                @Edwin If you encounter any problems with setting things up I am yours to help

                E 1 Reply Last reply 3 Feb 2016, 22:53
                1
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 3 Feb 2016, 21:23 last edited by
                  #9

                  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.

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  1
                  • M michelson
                    3 Feb 2016, 21:11

                    @Edwin If you encounter any problems with setting things up I am yours to help

                    E Offline
                    E Offline
                    Edwin
                    wrote on 3 Feb 2016, 22:53 last edited by Edwin 2 Mar 2016, 22:55
                    #10

                    @michelson Wow, okay, it actually works. I am so grateful right now (and also, totally overworked). Thanks a lot!

                    So, how do I flag this thread answered?

                    1 Reply Last reply
                    1
                    • S Offline
                      S Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on 3 Feb 2016, 22:55 last edited by
                      #11

                      Use the "Topic Tool" button :)

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      1 Reply Last reply
                      1

                      11/11

                      3 Feb 2016, 22:55

                      • Login

                      • Login or register to search.
                      11 out of 11
                      • First post
                        11/11
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved