It is quite difficult to explain this with the information you provide. This clearly indicates a build order problem, even if you have documented that A is first created.
You may have a problem with the parallel build feature available in VS. If he does not see the relationship between projects, he allows projects to be built simultaneously using your machine with several processor cores. You can see the initial building, but B also begins to build right away. It is indicated with numbered messages in the "Exit" window, preceded by 1> and 2>.
If there really is an addiction, it becomes a race. If B goes to the linking stage before A connects, then this will certainly have problems. But it is usually declared that he cannot find the import library for the DLL project. Finding an old version of A.lib that lacks some identifiers would be an unusual corner case. However, it is still interesting when he finds A.lib during his writing. Which explains what you observed.
The best thing to do is to make sure that VS knows that there is a dependency, not relying on what she finds out. It is not good to understand this for C or C ++ projects. Right-click your project B in the Solution Explorer window and select Project Dependencies. Check the project A. Now it will no longer build at the same time, B will not start building until it is done A. In fact, this is what you did manually to solve this problem.
If you still have problems, you will need to suspect other programs on your computer, such as a mess with files. Antivirus software is always at the top of the list of troublemakers. Avast is particularly notorious for the fact that VS is very hard.
source share