I am trying to build a C++ program in VS2010 and encountered an error that I've never seen before.
LINK: fatal error LNK1104: cannot open file C:...\Debug\labfour.ilk
I searched for solutions but wasn't able to find any other instances of visual studio linker being unable to open the .ilk file. Does anyone know why something like this would happen? I'm wondering if there's a solution that's similar to that of the error cannot find or open the PDB file
, where you have to adjust some of the settings in the solution explorer properties.
Any insight would be greatly appreciated, thank you.
In my experience this is one of two things:
The .ilk file is broken. Just clean and rebuild; if that doesn't purge the .ilk file then whack it yourself. This file is prone to getting broken, in case of cancelled builds usually I think.
You're building two projects configured to write the same .ilk file, or using incremental linking (Linker>General>Enable Incremental Linking) + /MP (C/C++>General/multi-processor compilation). This can fail intermittently and sometimes when it fails it can break the .ilk file. I'm less confident about this scenario though.