Reputation: 594
I have two solutions that both include and reference the same static library. And I'm including the library using the "Add reference..." feature, as opposed to specifying additional an linker input. It seems as though when I build one of the solutions, it causes the other solution to think it needs to rebuild the shared library, which then causes it to re-link the second solution. Thus, if I go back and forth between the two solutions building (without making any code changes) the solutions perform the link every time.
It doesn't appear that the shared static library is actually being re-compiled, but VS is performing the librarian step for it. I'm guessing this librarian step is happening because the .lastbuildstate file (which contains a path to the solution that last build the project) is determined to be outdated.
Anybody ever experienced this problem before? Is there a better way to go about this?
Upvotes: 0
Views: 277
Reputation: 8866
If the library is really shared and independent from both solutions, I'd suggest moving it to a separate solution... I understand that's not really what you intended, but it seems logical by the nature of dependencies itself.
Another consideration in favor of this is that the library may be later used for other projects. Hence, it'd be totally better to move it to a separate location (separate solution, separate folder in VCS) and treat it as any third-party library (i.e. openssl, boost, etc), specifying the dependency as linker input.
All of the above is just my thoughts on how I'd do it and is not a representation of any "best practices".
Upvotes: 1