Tiered library dependencies under VS2005

We have a project that is structured like this:

Program depends on

Library 1a which depends on

Library 2a, Library 2b, etc.

The dependencties for the above are set by right clicking each project and selecting Project Dependencies... and selecting the projects immediately below the projects in the dependency tree.

If I modify a source file in Library 2a and then right-click on Library2a and select Build, it builds the library. If I now right-click on Library1a or Program and select Build, I see the message

========== Build: 0 succeeded, 0 failed, N up-to-date, 0 skipped ==========

so, nothing gets relinked and Program is out of date. If I modify one of the .cpp source files for Library1a and then select Build for Program, Library1a gets relinked as does Program, so, all is well.

This works correctly under VS .NET.

The build was done from new solution and .vcproj files, not a converted VS .NET solution and .vcproj files.

Any suggestions



Answer this question

Tiered library dependencies under VS2005

  • chuck.dickens

    What seemed to be happening is that, under VS .NET, each library contained its own .obj files plus all the libraries below it. When the autoconvert of the .vcproj files ran, it made the libraries contain only their own .obj files and not the libraries below.

    What I did under VS 2005 was to make the top library in the dependency tree have LinkLibraryDependencies be true. This made it contain all its .obj files and all those from the libraries flagged as its children. I changed all the projects that linked to libraries lower in the tree to link to the top library; this may have made the link slower, but all the lower-level .obj files are now visible to the linker.


  • THERAOT

    That sounds odd. As a workaround you could always add your subdependencies to the dependencies of your main project.

  • kingflux

    FYI: in VC6 the behavior was to link in "sub-dependencies" directly to the "ultimate" parent instead of their immediate parent, while in VC7 the behavior changed to directly link each dependent lib into its immediate parent. we had some customer complaints about the VC7 behavior (it can result in really nasty large .lib files and horrible link times), so we reverted to the VC6 behavior early in VC8. when the beta of VC8 came out, we had some customers insist that they wanted the VC7 behavior back... so we put in the switch to let the users choose. unfortunately, the default for the switch isn't going to be what everybody wants...

    I hope this didn't cause you too much grief. sorry for the confusion,

    josh

    VC++ project system developer



  • Tiered library dependencies under VS2005