Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2010 cannot open .ilk file

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.

like image 926
BabaSvoloch Avatar asked Mar 16 '16 22:03

BabaSvoloch


1 Answers

In my experience this is one of two things:

  1. 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.

  2. 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.

like image 133
zeromus Avatar answered Sep 25 '22 22:09

zeromus