I'm on Windows and I'm building my CMake project using MSVC. When I select Visual Studio as the CMake generator, everything works perfectly. However, when I use either the NMake or Ninja generator (in a properly configured command prompt), most of my DLL linking steps fail with the following error:
C:/Program Files (x86)/Windows Kits/8.1/bin/x64/mt.exe : general error c101008d: Failed to write the updated manifest to the resource of file "path\to\the.dll". The operation failed.
Re-running the exact same command (`nmake` or `ninja`) without doing anything else occasionally solves the problem (it seemed to me it was solved more often with NMake than with Ninja, but I can't be sure), but now I've reached a point where all remaining DLLs consistently fail to link due to the manifest issue.
I'd be happy to try to debug/locate the issue myself, but since the error message I get is so wonderfully unhelpful, I don't know *how* to look into it, or even where to start. Would anyone have any ideas how to look what the issue could be?
My googling came up with two possibilities: a race with an antivirus for checking the binary file, or write protection on the output directory. I've verified that the directory in not write-protected, and it's in a location which is excluded from AV checks. And anyway, if either of these were the cause, I'd expect the exact same errors when using the Visual Studio IDE to build, but such errors *never* happen there.