I need to link library from one project into another, and it looks there are 2 ways, can you tell what is the difference and what is the consequence of having "true" in one setting and "false" in another (the same) setting?:
and another one:
What is the difference, and do I need both setting set to "yes" or just one and if so which one?
To create a static library project in Visual StudioOn the menu bar, choose File > New > Project to open the Create a New Project dialog. At the top of the dialog, set Language to C++, set Platform to Windows, and set Project type to Library.
A one-line explanation would probably be that the second option specifies something about how the first one works.
.lib
file, then that file will be linked in automatically..lib
generated by another project changes, and the current project depends on it, the linker can no longer link the current project incrementally (it's difficult for it to know how exactly the .lib
changed). If you set this option to Yes, then the linker doesn't use the .lib
file generated for the other project, but rather the individual .obj
files that were used by the librarian to generate that .lib
(as if the .lib
didn't exist, and every object file from the other project were given to the linker individually, alongside the .obj
files from the current project). This enables it to continue linking incrementally.As far as I can tell, Use Library Dependency Inputs only makes sense if Link Library Dependencies and Enable Incremental Linking are both also set to Yes, and the current project depends on another project that generates a .lib
file that changes often during development.
Additional information here and reference docs here.
UPDATE based on the comment from the OP:
As far as I can tell, the property entry under Project Reference Properties specifies the setting individually for each referenced project (whether to use the .lib
from that specific project or not), while the one under Linker - General is the default setting for referenced projects.
For example, if you set the one under Linker - General to No and add a new referenced project, then, for that project, the setting under Project Reference Properties will default to False. However, the settings for referenced projects that were added before keep their individual setting.
I expect the individual setting under Project Reference Properties to override the default from Linker - General, but I haven't actually tested this bit.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With