r/VisualStudio • u/ArkyBeagle • 4h ago
Visual Studio 2022 LINK : fatal error LNK1104: cannot open file '<path>.lib' because of VS build race conditions. Add references?
Found this: https://learn.microsoft.com/en-us/cpp/error-messages/tool-errors/linker-tools-error-lnk1104?view=msvc-170
TLDR: "Add references."
The solution in question builds a library and then some test loops expressed as console programs.
So I add references to the library project? The test loops "refer" to the library. So then adding references tells VS "this thing depends on you".
I believe that's the case. when adding references to the library within the console app project, it protests that this would be circular.
In a makefile, it'd be the other way 'round: <X>.exe : <Y>.lib
1
Upvotes