Reputation: 22890
Lets say I have a solution S1
with two projects pdep
and pmaster
, respectively creating a static and dynamic library. I have the configurations:
pdep.lib
pdepd.lib
pdepx64.lib
pdepx64d.lib
pmaster
link configuration is done by Configuration Properties -> Linker -> Input -> Additional Dependencies
No #pragma comment(lib ) in the code. No common properties references.
What I observe :
In s1 with both pdep and pmaster the command line for the linker is fine. ie /LIBPATH:"c:\pdep\lib\x64\Release" "pdepx64.lib"
In a solution S2 freshly created by clicking on the project pmaster, I always have an additional line with an absolute path to a specific version of pdep, regardless of the configuration. ie /LIBPATH:"c:\pdep\lib\x64\Release" "pdepx64.lib" "c:\pdep\lib\pdepd.lib"
How does the linker in S2 derives the additional option "c:\pdep\lib\pdepd.lib"
?
How do I get rid of it?
Upvotes: 1
Views: 65
Reputation: 5642
You can flatten the project file using msbuild with a preprocess flag. Then load that into a plain text or xml editor. Look at the linker command and see what $(properties) hold the options, and then look at where that is being set.
With msbuild you can also use more verbose logging and it will report which conditions are evaluated and such.
Upvotes: 0
Reputation: 18411
Multiple possibilities:
#pragma comment(lib...)
is playing some roleUpvotes: 1