VS 2012 does not create a dependent project

I have two C ++ projects in Visual Studio 2012 (version 11.0.50727.1). Project B depends on project A, through Project Properties> General Properties> Structure and Links .

When I do rebuild on B, the lib for project A is not generated in the output directory, so B fails. Logs show that A is building successfully, but lib just isn't showing up.

The really strange part is that when I do a “clean build” instead of a “rebuild”, everything works correctly. Similarly, Project A builds on its own and creates .lib. Unfortunately, the build system that I have to use will perform a "rebuild", and I would prefer not to change this if possible.

What i tried

I removed the link to the framework and tried to add lib as the linker dependency in B. In this case, A still could not be built, so I ended up with the missing link.

I searched for SO and google for a while, but haven't figured it out yet.

Please let me know if you have ever come across anything like this!

0
source share
1 answer

It seems that the problem was that A and B shared the staging directory. Creating two different elements seems to fix the problem.

Here is my hunch about what's going on:

  • And it’s built correctly.
  • B begins to build, making "clean"
  • , , A.lib .
  • A.lib

VS, , , , .

+1

Source: https://habr.com/ru/post/1538901/


All Articles