Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. LINK1104: "D:\Windows.obj" file not found while building a simple opencv project.
Forum Updated to NodeBB v4.3 + New Features

LINK1104: "D:\Windows.obj" file not found while building a simple opencv project.

Scheduled Pinned Locked Moved Unsolved 3rd Party Software
27 Posts 5 Posters 6.5k Views 3 Watching
  • 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.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #15

    On Windows, you can't mix and match C++ libraries built with different compilers. The only exception currently is VS2017 being backward compatible with VS2015.

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

    S 1 Reply Last reply
    1
    • SGaistS SGaist

      On Windows, you can't mix and match C++ libraries built with different compilers. The only exception currently is VS2017 being backward compatible with VS2015.

      S Offline
      S Offline
      Somesh Singh
      wrote on last edited by
      #16

      @SGaist
      So why am i getting the error for the ".obj" file not found
      As shown in the example that i posted..its just configured to be used with Qt 5.12.0MSVC2017 x64
      So why does it not work.

      i was just trying different ways to make it work with a different compiler to check the integrity of my program .

      kshegunovK 1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #17

        You should compare the Makefile generated by your CMake project and the one from the .pro file

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

        S 1 Reply Last reply
        0
        • SGaistS SGaist

          You should compare the Makefile generated by your CMake project and the one from the .pro file

          S Offline
          S Offline
          Somesh Singh
          wrote on last edited by
          #18

          @SGaist
          Is there something specific that i should be looking for??
          I am not an expert in debugging by just looking at the 2 files.

          1 Reply Last reply
          0
          • S Somesh Singh

            @SGaist
            So why am i getting the error for the ".obj" file not found
            As shown in the example that i posted..its just configured to be used with Qt 5.12.0MSVC2017 x64
            So why does it not work.

            i was just trying different ways to make it work with a different compiler to check the integrity of my program .

            kshegunovK Offline
            kshegunovK Offline
            kshegunov
            Moderators
            wrote on last edited by
            #19

            @Somesh-Singh said in LINK1104: "D:\Windows.obj" file not found while building a simple opencv project.:

            So why am i getting the error for the ".obj" file not found

            @SGaist said in LINK1104: "D:\Windows.obj" file not found while building a simple opencv project.:

            On Windows, you can't mix and match C++ libraries built with different compilers. The only exception currently is VS2017 being backward compatible with VS2015.

            Let's go back a step. Firstly your LIBS variable is incorrect. Secondly you're linking system libraries which from the code example it seems you shouldn't. And thirdly, if a set of libraries worked with mingw then they were compiled with mingw (hence the quote from @SGaist). That set of libraries can not, and shall not be used with msvc, ever. You need a set of libraries compiled with msvc to use them in an application built with msvc. This also extends to the msvc version - for example msvc2015 isn't backwards compatible, so you likely need to match the versions as well.

            Read and abide by the Qt Code of Conduct

            S 1 Reply Last reply
            1
            • kshegunovK kshegunov

              @Somesh-Singh said in LINK1104: "D:\Windows.obj" file not found while building a simple opencv project.:

              So why am i getting the error for the ".obj" file not found

              @SGaist said in LINK1104: "D:\Windows.obj" file not found while building a simple opencv project.:

              On Windows, you can't mix and match C++ libraries built with different compilers. The only exception currently is VS2017 being backward compatible with VS2015.

              Let's go back a step. Firstly your LIBS variable is incorrect. Secondly you're linking system libraries which from the code example it seems you shouldn't. And thirdly, if a set of libraries worked with mingw then they were compiled with mingw (hence the quote from @SGaist). That set of libraries can not, and shall not be used with msvc, ever. You need a set of libraries compiled with msvc to use them in an application built with msvc. This also extends to the msvc version - for example msvc2015 isn't backwards compatible, so you likely need to match the versions as well.

              S Offline
              S Offline
              Somesh Singh
              wrote on last edited by
              #20

              @kshegunov

              I have specific set of libraries for both mingw and msvc.
              Also, i linked the system libraries in the .pro file as it was not accepting them from the system variables "PATH"
              My issue is just during the compilation with opencv.

              For eg., Qt has its included examples just to try out for beginners, those examples run completely fine, which means the problem lies somewhere in the code itself which i wrote.

              0_1549927377207_2c5e7161-0e8d-46f7-a940-69a67ad3e1ed-image.png

              these are all the compilers i have which are seperately

              0_1549927469876_fbd57746-4af4-4f11-9815-73b8d8dda0c1-image.png

              I need to get my default compiler to work with opencv.
              thats my end goal

              kshegunovK 1 Reply Last reply
              0
              • S Somesh Singh

                @kshegunov

                I have specific set of libraries for both mingw and msvc.
                Also, i linked the system libraries in the .pro file as it was not accepting them from the system variables "PATH"
                My issue is just during the compilation with opencv.

                For eg., Qt has its included examples just to try out for beginners, those examples run completely fine, which means the problem lies somewhere in the code itself which i wrote.

                0_1549927377207_2c5e7161-0e8d-46f7-a940-69a67ad3e1ed-image.png

                these are all the compilers i have which are seperately

                0_1549927469876_fbd57746-4af4-4f11-9815-73b8d8dda0c1-image.png

                I need to get my default compiler to work with opencv.
                thats my end goal

                kshegunovK Offline
                kshegunovK Offline
                kshegunov
                Moderators
                wrote on last edited by kshegunov
                #21

                Okay, let me rephrase:

                INCLUDEPATH += "D:\Windows Kits\10\Include\10.0.17763.0\ucrt"
                INCLUDEPATH += "D:\Windows Kits\10\Include\10.0.17763.0\ucrt\sys"
                

                Why do you need this?

                LIBS += D:\Windows Kits\10\Lib\10.0.17763.0\um\x64\shell32.lib
                

                What part of the system API you're using, so you need this one? (may be the source of your error too).

                LIBS += D:\OpenCV\opencv\build\bin\Release\opencv_core400.dll
                LIBS += D:\OpenCV\opencv\build\bin\Release\opencv_highgui400.dll
                LIBS += D:\OpenCV\opencv\build\bin\Release\opencv_imgcodecs400.dll
                LIBS += D:\OpenCV\opencv\build\bin\Release\opencv_imgproc400.dll
                LIBS += D:\OpenCV\opencv\build\bin\Release\opencv_features2d400.dll
                LIBS += D:\OpenCV\opencv\build\bin\Release\opencv_calib3d400.dll
                

                One does not link .dlls, one links against them with the help of a .lib.
                https://doc.qt.io/qt-5/qmake-variable-reference.html#libs

                PS.
                Did you compile opencv with the version of msvc you're trying the build the application with?

                Read and abide by the Qt Code of Conduct

                S 1 Reply Last reply
                2
                • kshegunovK kshegunov

                  Okay, let me rephrase:

                  INCLUDEPATH += "D:\Windows Kits\10\Include\10.0.17763.0\ucrt"
                  INCLUDEPATH += "D:\Windows Kits\10\Include\10.0.17763.0\ucrt\sys"
                  

                  Why do you need this?

                  LIBS += D:\Windows Kits\10\Lib\10.0.17763.0\um\x64\shell32.lib
                  

                  What part of the system API you're using, so you need this one? (may be the source of your error too).

                  LIBS += D:\OpenCV\opencv\build\bin\Release\opencv_core400.dll
                  LIBS += D:\OpenCV\opencv\build\bin\Release\opencv_highgui400.dll
                  LIBS += D:\OpenCV\opencv\build\bin\Release\opencv_imgcodecs400.dll
                  LIBS += D:\OpenCV\opencv\build\bin\Release\opencv_imgproc400.dll
                  LIBS += D:\OpenCV\opencv\build\bin\Release\opencv_features2d400.dll
                  LIBS += D:\OpenCV\opencv\build\bin\Release\opencv_calib3d400.dll
                  

                  One does not link .dlls, one links against them with the help of a .lib.
                  https://doc.qt.io/qt-5/qmake-variable-reference.html#libs

                  PS.
                  Did you compile opencv with the version of msvc you're trying the build the application with?

                  S Offline
                  S Offline
                  Somesh Singh
                  wrote on last edited by
                  #22

                  @kshegunov i changed the .dll to .lib

                  the only reason i included the shell32.lib file was because it shows that it cannot find the specified file before giving me the error that "Cannot find file D:\Windows.obj"

                  Also i built opencv using both MSVS 2017 x64 and mingw x86.
                  the build was succesfull without any errors in the process.

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #23

                    Then you have to ensure the path you are using points to the OpenCV version built by the same compiler as you are currently using for 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

                    S 1 Reply Last reply
                    1
                    • SGaistS SGaist

                      Then you have to ensure the path you are using points to the OpenCV version built by the same compiler as you are currently using for your application.

                      S Offline
                      S Offline
                      Somesh Singh
                      wrote on last edited by
                      #24

                      @SGaist I have tried adding all the paths to the system variable path manager but its still the same.
                      Does my Qt have any configuration issues while compiling or building.
                      I also ran configure.bat from the source folder to properly configure the environment but still no progress.

                      1 Reply Last reply
                      0
                      • SGaistS Offline
                        SGaistS Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on last edited by
                        #25

                        Did you try to use a pre-built version of OpenCV ?

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

                        S 1 Reply Last reply
                        0
                        • SGaistS SGaist

                          Did you try to use a pre-built version of OpenCV ?

                          S Offline
                          S Offline
                          Somesh Singh
                          wrote on last edited by
                          #26

                          @SGaist
                          Where can i get the prebuilt version.
                          i used OpenCV 4.0.0 from the website. and built it from scratch.
                          Do you think i might have excluded some packages from Cmake while building and configuring.

                          1 Reply Last reply
                          0
                          • SGaistS Offline
                            SGaistS Offline
                            SGaist
                            Lifetime Qt Champion
                            wrote on last edited by
                            #27

                            https://opencv.org/releases.html

                            Version 4.0.1 is available as it seems.

                            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

                            • Login

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