Even after rebuilding I am getting this error, but XXX.lib is not a dependency of the project in the current build configuration... it is the dependency of another configuration though.
Since rebuilding isn't helping, I'm stuck as it seems to happen every time suddenly (I did not alter project settings).
It's similar to this, but not quite I think: Visual Studio: LINK : fatal error LNK1181: cannot open input file