UmNyobe
UmNyobe

Reputation: 22890

VS2010 linking of static library behave differently in separate solutions

Lets say I have a solution S1 with two projects pdep and pmaster, respectively creating a static and dynamic library. I have the configurations:

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 :

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

Answers (2)

JDługosz
JDługosz

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

Ajay
Ajay

Reputation: 18411

Multiple possibilities:

  • Common Properties -> References
  • Link Library Dependencies in Linker or Librarian section. This assumes that Project Dependencies have been setup.
  • #pragma comment(lib...) is playing some role

Upvotes: 1

Related Questions