Visual Studio C++ (Express) 2022, LNK1105 and LNK1104

16 Views Asked by At

I recently started dusting off my C++ skills and fired up a new windows application in VS2022. What is weird is that the program will compile fine ... until I change something. When I attempt to compile, it gives me the error LNK1105 "cannot close file ****.exe". If I attempt to compile again, this time I get LNK1104 "cannot open file ****.exe". Third time is the charm. I can still work, but I'm wondering if there is a way around having to compile three times every time I make a change? I have looked extensively on the web for a solution but nobody's problem seems to quite exactly match this. Exe is not running in the background; I scanned the task list thoroughly, restarted Visual Studio, even my PC.

Looked in the project directory. The *.exe is there after the LNK1105 error, but after the LNK1104 error, it disappears. It reappears after the third and successful compile + link. All directories are default; even the DirectX directories are included in the default (much easier than it was 20 years ago).

0

There are 0 best solutions below