June 17th, 2024

How can I view the list of symbols available in a library?

When investigating unresolved external symbols, you may end up digging into library files to find out why a library doesn’t contain a symbol you expect it to.

The command for listing the symbols exported by a library is dumpbin /linkermember.

dumpbin /linkermember mystery.lib

By default, /linkermember lists all the symbols twice, once in object order (the order in which they appear in the library), and again in alphabetical order. You can ask for just the alphabetical one by saying /linkermember:2.

The list of exported symbols tends to be quite large, so if you’re looking for just one symbol, you probably want to grep it out.

dumpbin /linkermember:2 libcmt.lib | findstr /i printf

Note that the names are printed raw, with no undecorating.

Bonus chatter: The DUMPBIN program is really just a wrapper. All it does is run LINK.EXE with the /DUMP command line option, followed by whatever options you passed to DUMPBIN. If you want, you can just go directly to LINK.EXE:

link /dump /linkermember mystery.lib
Topics
Code

Author

Raymond has been involved in the evolution of Windows for more than 30 years. In 2003, he began a Web site known as The Old New Thing which has grown in popularity far beyond his wildest imagination, a development which still gives him the heebie-jeebies. The Web site spawned a book, coincidentally also titled The Old New Thing (Addison Wesley 2007). He occasionally appears on the Windows Dev Docs Twitter account to tell stories which convey no useful information.

5 comments

Discussion is closed. Login to edit/delete existing comments.

Newest
Newest
Popular
Oldest
  • Dimiter Stanev

    While dumpbin is useful, I find having `nm` (like llvm-nm on Windows) more practical. As long as you not working with LTCG symbols, it’ll read most (if not all of it).

  • 承昊 周

    please Support ASPX page on .netcore.
    how many people are using razor-page?it is a html.
    i know very more persons are using ASPX-page. i don’t known why netcore not support aspx?
    design for using,not for designing.
    设计是为了用的,不是为了设计而设计的,更不是为了显得自己高明而设计的。

  • Paulo Pinto

    Dependency Walker is just as valuable as dumpbin if not more so, when investigating unresolved external symbols across dynamic libraries, yet there is nothing on the Windows SDK as alternative, and the old version hardly works on modern Windows versions.

    • Me Gusta

      While that kind of tool is useful for working out problems with runtime dependencies, the post itself isn’t about that.
      If you look at the sample commands, they end in a .lib extension. So this is about link time issues, dealing with LNK2001 and LNK2019.

    • Rob Conde

      I’m not sure what/if anything is missing wrt Dependency Walker, but this tool is a great alternative: https://github.com/lucasg/Dependencies

Feedback