Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8387765
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:18:14+00:00 2026-06-09T18:18:14+00:00

I’m using Visual Studio 2010, with a lot of project and solution files. But

  • 0

I’m using Visual Studio 2010, with a lot of project and solution files. But now I find myself in a bit of dependency hell with ProjectReferences:

  • Project Simple produces a static lib.
  • Projects Foo and Bar depend on Simple, and also produce static libs.
  • Project Module depends on Foo and produces a DLL.
  • Project Module2 depends on Bar and produces a DLL.

So the dependency tree looks like this:

                Simple
                  |
     ____________/ \__________
     |                        |
    Foo                      Bar
     |                        |
   Module                   Module2

With ProjectReferences, I can make Module depend on Foo and automatically link Foo.lib. This works fine.

But, is there a way for Module to automatically link in Simple.lib?

It seems like that should be possible. Module depends on Foo, which depends on Simple, so it seems like it should be able to have an option for “link in the output of my references and my references’ references”. But I can’t find anything that lets me do that.

The “Link Library Dependencies” option doesn’t do it. It only links in Foo.lib, and then I get a linking error about unresolved external symbols (symbols which are defined in Simple.lib).

Setting “Link Library Dependencies” to true for the Foo->Simple and Bar->Simple references seems to work at first, until you have a project that uses both Foo and Bar. That setting actually embeds Simple.lib inside of Foo.lib and Bar.lib, and then you get “symbol is already defined” errors if you try to use both Foo.lib and Bar.lib. And that’s the correct error – I don’t actually want to put Simple.lib inside of any other lib.

I can add a ProjectReferece from Module to Simple, but that’s tedious to set in every project that uses Foo, and it’s violating the encapsulation of Foo. Module should not need to know about Simple. Obviously the linker needs to know about Simple, but it should be able to figure that out by following ProjectReferences.

Here’s why this matters: Suppose, during maintenance, a new project is created: Basic, which creates a static lib, and Simple depends on Basic. Now we have to update every single project that has a ProjectReference to Simple directly or through another ProjectReference (in this example it’s only two projects, Module and Module2, but in reality it’s dozens). That’s tedious.

tl;dr Is there a way to automatically link in the static libs of my dependencies?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T18:18:15+00:00Added an answer on June 9, 2026 at 6:18 pm

    Apparently, this is a bug in Visual Studio 2010:
    https://connect.microsoft.com/VisualStudio/feedback/details/638534/unresolved-externals-when-build-a-vc-project-with-chained-static-lib-dependencies#details

    Unfortunately, Microsoft closed the bug as “fixed” — which isn’t quite true. It’s more of a workaround, but it’s not what I would consider a real fix. (A real fix would be a patch or a service pack, not something that needs to be manually tweaked on every machine).

    The “fix” is to do the following:

    Modify %ProgramFiles(x86)%\MSBuild\Microsoft.cpp\v4.0\Microsoft.CPPBuild.Targets
    And change the line:

    <Target Name="GetResolvedLinkLibs" Returns="@(LibFullPath)"
     DependsOnTargets="$(CommonBuildOnlyTargets)">
    

    To

    <Target Name="GetResolvedLinkLibs" Returns="@(LibFullPath)"
     DependsOnTargets="$(CommonBuildOnlyTargets);ResolvedLinkLib">
    

    So, just add the ;ResolvedLinkLib part to that file. Then VS will link in dependencies of dependencies.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Seemingly simple, but I cannot find anything relevant on the web. What is the
I have thousands of HTML files to process using Groovy/Java and I need to
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a jquery bug and I've been looking for hours now, I can't
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.