I had this problem because different projects in a solution had the same intermediate directory.
Changing
$(Platform)$(Configuration)
to
$(Platform)$(Configuration)$(ProjectName)
in
Configuration Properties | General | Intermediate Directory
in each of the projects solved it.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…