Home Dashboard Directory Help
Search

"Link Library Dependencies" does not work by TonyHBCS


Status: 

Closed
 as By Design Help for as By Design


3
0
Sign in
to vote
Type: Bug
ID: 586113
Opened: 8/13/2010 8:48:01 AM
Access Restriction: Public
0
Workaround(s)
view
6
User(s) can reproduce this bug

Description

Setting "Link Library Dependencies" to "Yes" does not work: Unresolved externals result. Only when the static library is added manually to the project does the library get linked.
Details
Sign in to post a comment.
Posted by Microsoft on 4/30/2014 at 6:06 PM
Hi, I just want to pop in this thread to clarify and address users feedback.
Assuming the project state is:
Exe <- Lib1, Lib2, Lib3, LibDll

Project Exe has a reference to Lib1 and Lib2.
Lib1 and Lib2 has a reference to Lib3.
Lib3 reference LibDll

The expect when building Project Exe with "Link Library Dependencies" == true, is DLL <- Lib1, Lib2, Lib3, LibDll. When "Link Library Dependencies" == false, DLL will not consume any Lib#. "Link Library Dependencies" could also be specified on a per project reference for even tighter control.

When the Project LibDll has $(IgnoreImportLibrary) property set to true, then the project would not provide a lib to its parent.

From what I recall in VS2010, Lib3 and LibDll was missing. It was fixed via this workaround. (http://stackoverflow.com/questions/6437538/vs2010-static-linking-issue). And is fixed in next version of Visual Studio.

Thanks

Felix Huang
VC++ Project & Build
Posted by ppsmtl on 1/16/2014 at 8:35 PM
For those who still don't get it, here's the correct answer: http://stackoverflow.com/a/7685335/468725
Posted by Deuscide on 9/25/2013 at 10:33 AM
Add my name to the list of the confused, more so after reading Microsoft's official statement. What does this value actually do now? The work around is to go to individual projects and force linkage by adding the name of the library, which contributes many possible points of failure, and maintenance issues. The issue is if MS is changing expected (previously supported) behavior. If this official reply is "as expected", then we are too assume other behaviors are up for such drastic changes. And in this case, perhaps stubbed - perhaps "Build Solution" is next?
Posted by stevenTc on 7/23/2013 at 5:15 AM
"Link Library Dependencies" appears in two places in the project properties GUI. The one under Config Properties > Linker > General no longer works in VS 2010 as it did in previous version. This is definitely not "by design", unless MS is in the habit of designing red herring GUI features that have no effect. It's not a show stopper issue, but it would be nice if MS could acknowledge it in a mature way, rather than giving the dismissive "by design" response.
Posted by Martin Ba. _ on 10/7/2011 at 2:38 AM
The answer posted by Amit Mohindra (8/23/2010) is either seriously under explained or seriously wrong.

The title of this bug reads: ["Link Library Dependencies" does not work] which is in fact true. It doesn't do what it used to do. Actually it appears it does nothing (http://stackoverflow.com/questions/7683869/what-does-the-link-library-dependency-linker-option-actually-do-in-visual-studi).

If this option does nothing, then it is a bug (remove it FCS!)
If this option does something, please explain what.
Posted by Dirk De Baer on 10/6/2010 at 7:22 AM
In Visual Studio 10 I experienced the same issue: although the dependency to the library was set with "project dependencies" and the "Link Library Dependencies" flag is set to "Yes", the library is NOT linked in. This behaviour is different from previous versions of Visual Studio, and not according to the documentation which says:

"Gives you the choice of linking in the .lib files that are produced by dependent projects. Typically, you will want to link in the .lib file."
Posted by Microsoft on 8/23/2010 at 5:14 PM
Hi Tony,

Thanks for reporting this feedback. The issue you are experiencing is by design. "Link Library Dependency" is a flag that only dictates whether or not to pass the library as an input to the linker. It does not find the dependency automatically. As a customer you will have to define the depedency manually as you suggest.

Thanks,
Amit Mohindra
Visual C++ Team
Posted by Microsoft on 8/13/2010 at 8:40 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.