'LINK : fatal error LNK1104: cannot open file '.obj'

I have a big problem with building a simple program. I am using many tutorials, instructions and I can't solve it. I edit the variable's path as follows:

C/C++->General->Additionals Include Directories->MyOpenCv\build\include Linker->General->Additionals Library Directories->MyOpenCv\build\x86\vc11\lib Linker->Input->Additional Dependencies->*I added .libs

The same in Debug and Release.

Windows 8 x64, VS2012 x32, OpenCV 2.4.5



Solution 1:[1]

Go to C/C++ -> Output Files and check Object File Name. Chances are it contains a bogus macro reference.

Solution 2:[2]

For C/C++, I have found for Visual Studio the location listed below is NOT the correct way to reference library files during linking the compiler-linking stage (at least in Community Version 2017). I had a project folder called 'lib' which contained all my .lib files. Originally I had specified a value like

Linker --> General --> Additional Library Directories: $(ProjectDir)lib;%(AdditionalDependencies)

I was getting error messages like:

error LNK1104: cannot open file 'lib.obj'

I figured out this was the correct way to specify the library directories:

VC++ Directories --> Library Directories

In my case, my value was:

VC++ Directories --> Library Directories: $(ProjectDir)lib;$(LibraryPath)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 C.D.