0

I have this huge ond very old C++ project I am building with Visual Studio 2017 using the VS 2013 compiler and Incredibuild.

When I am building the project I very often get LNK1104 linker errors, that the output file can't be opened. If I build again after getting the error, linking this project works fine but I get the same error with one of the next projects in the solution.

Sometimes this error doesn't occur and the whole solutions builds fine and other times I get this error a dozen times until I have all the projects build.

It looks like VS is blocking itself but I have no clue where to look at and didn't find many helpful clues so far. But this is driving me crazy.

Jarlaxle
  • 1
  • 1
  • For those of us that don't know what error `LNK1104` is, [this reference](https://learn.microsoft.com/en-us/cpp/error-messages/tool-errors/linker-tools-error-lnk1104?view=vs-2017) say it's "The linker could not open the specified file." – Some programmer dude Nov 19 '18 at 08:19
  • As for possible reasons, it seems that IncrediBuild build multiple object files in parallel (and distributed). Perhaps the project dependencies are not set up correctly so that the system tries to link before all object files are built? Is it possible to disable it? And if so, does it fix the problem? – Some programmer dude Nov 19 '18 at 08:20
  • There is an option for parallel linking in Incredibuild which was active. I deaktivated it and will try if it makes a difference. PS: What I forgott to mention is that the file that can't be opened is always the one currently in build. – Jarlaxle Nov 19 '18 at 08:30

1 Answers1

0

I've had similar issues with Incredibuild and it was always one of two reasons:

  • My project build order was wrong, so I was ending up trying to link to a lib/dll that was not builded yet
  • A running program somewhere else on my computer was already using one of the dll/exe I was trying to build

Try to review your build order by setting up each project's dependencies in Solution >> Project Dependencies >> Dependencies

VincentDM
  • 469
  • 6
  • 17