Visual Studio 2010 - LINK : fatal error LNK1181: cannot open input file " ■/.obj"
Visual Studio 2012 - LINK : fatal error LNK1181: cannot open input file “ ■/.obj” I'm using VS 2012!!!!
I have tracked this down a bit more. For me, this does NOT happen when I try to build the x64 bit version of my application. I have found that my project .vcxproj has an 'ImportGroup Condition' that looks like this:
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
I also have one for my x64 build that looks like this:
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
So I took a look at the files:
Users\??????????\AppData\Local\Microsoft\MSBuild\v4.0
Microsoft.Cpp.Win32.user.props
Microsoft.Cpp.x64.user.props
The difference is that the of each is different. x64 is basically empty while Win32 has three paths in it.
The section of the Win32 version, contains three paths, <ExecutablePath>
, <IncludePath>
, and <LibraryPath>
.
I HAVE FOUND that removing the <ExecutablePath>
path causes this problem to go away. I am looking deeper into that path to see if anything pops out at me, but I thought I'd pass it along in case any others can find what is wrong with that path.
Well it has been a while since posting this questions. I figured out a workaround awhile ago, so now I am going to answer it myself. But if you have any better ideas or additional info others could benefit from, please post.
I found that after creating my C++ project, I need to remove the "Microsoft.Cpp.Win32.User" property sheets. If I don't, then I get the strange error above, but if I delete them, the simple project compiles fine. To delete them...
- Select View->Other Windows->Propery Manager
- Expand the property group (the name of your project)
- Expand all configurations (mine are "Debug|Win32" and "Release|Win32")
- Multi-select all "Microsoft.Cpp.Win32.User" property sheets (one under each configuration)
- Delete