LINK1104: "D:\Windows.obj" file not found while building a simple opencv project.
-
@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 withmingw
then they were compiled withmingw
(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. -
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.
these are all the compilers i have which are seperately
I need to get my default compiler to work with opencv.
thats my end goal -
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
.dll
s, one links against them with the help of a.lib
.
https://doc.qt.io/qt-5/qmake-variable-reference.html#libsPS.
Did you compile opencv with the version of msvc you're trying the build the application with? -
@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. -
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.
-
@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. -
Did you try to use a pre-built version of OpenCV ?
-
https://opencv.org/releases.html
Version 4.0.1 is available as it seems.