Is there a better way than passing /verbose to link.exe in order to see the effect of #pragma comment(lib, ...)?

23 Views Asked by At

#pragma comment(lib, ...) can be quite useful to declare library dependencies (static or import) from within a translation unit. As far as I am aware the way #pragma comment(lib, ...) works is by transforming the library dependency into a /defaultlib:... internally (via the .drectve section of the COFF file). Being a default library, I think, affects search order and overall precedence, but the details don't appear to be well-documented (at least publicly).

However, there is one issue: one can seemingly only ever observe its effect but never see the real input order in which libraries and objects are passed under the hood.

While with LOG_BUILD_COMMANDLINES I can even see the effect of the usual environment variables (LINK etc.) on the respective command lines, the #pragma comment(lib, ...) seems to fly completely "under the radar" in that regard.

Question: is there a better way to see the actual effect on the input order to link.exe than passing it /verbose and trying to make sense of its output?

0

There are 0 best solutions below