LNK1104 cannot open file '…lib.obj'

2019-07-03 23:33发布

问题:

I'm trying to update Visual Studio 2012 C++ projects so that I can compile them in Visual Studio 2015 (Update 3). I've gotten it narrowed down to just one error in one project that I'm completely stumped on:

LNK1104 cannot open file 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib.obj'

I've installed all the C++ language options (they don't get installed by default) and even uninstalled and reinstalled Visual Studio.

That file doesn't exist in that directory, and it also doesn't exist in the Visual Studio 2012 directory either.

Anyone have any ideas on how to solve this?

回答1:

The problem might be that you added something like "$(VC_LibraryPath_x86)xxxx.lib" to the Linker input additional dependencies. This goes wrong, resulting in the error. It should just be "xxxx.lib".



回答2:

Check your path. If that's correct then make sure you've written xxx.lib rather than xxx