Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
497 views
in Technique[技术] by (71.8m points)

What does the "Link Library Dependency" linker option actually do in Visual Studio 2010 - 2015 and upwards?

Up to VS2008, you set your native C++ project dependencies up in the solution file (Project Dependencies ...) and if (by default) the Linker Option

Properties -> Linker -> General : Link Library Dependencies = Yes

is set, the Visual Studio Build will automatically link in the .lib files of all projects (DLLs, LIBs) that this project is dependent on will be "statically" linked in.


Side Note: Microsoft changed how the dependencies worked in VS2010 and you are now supposed to add the dependency directly to the project

Common Properties -> Framework and References : (List of depenencies) 

    (each lib/dll has a separate option: 
     Project Reference Properties -> Link Library Dependencies : True|False

I'm fine with that. This is not what this question is about.

(One explanation here: Flexible Project-to-Project References.)


It is still possible however to define project dependencies on the Solution level and the General Linker option is also still there. However it doesn't work. See:

and especially see here (acutal question follows)

Where Microsoft confirms that the Linker Option doesn't do what the rest of the world's population expects it to do, and adds the following explanation:

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.

Can anyone explain what that means, or more to the point: What does the "Link Library Dependency" linker option actually do in Visual Studio 2010?

What is an "input to the linker" that isn't actually linked supposed to be?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You have to give the setting the proper value to bring clarity:

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...