{"id":109905,"date":"2024-06-17T07:00:00","date_gmt":"2024-06-17T14:00:00","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/oldnewthing\/?p=109905"},"modified":"2024-06-17T09:00:45","modified_gmt":"2024-06-17T16:00:45","slug":"20240617-00","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20240617-00\/?p=109905","title":{"rendered":"How can I view the list of symbols available in a library?"},"content":{"rendered":"<p>When investigating unresolved external symbols, you may end up digging into library files to find out why a library doesn&#8217;t contain a symbol you expect it to.<\/p>\n<p>The command for listing the symbols exported by a library is <code>dumpbin <a href=\"https:\/\/learn.microsoft.com\/cpp\/build\/reference\/linkermember?view=msvc-170\">\/linkermember<\/a><\/code>.<\/p>\n<pre>dumpbin \/linkermember mystery.lib\r\n<\/pre>\n<p>By default, <code>\/linkermember<\/code> 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 <code>\/linkermember:2<\/code>.<\/p>\n<p>The list of exported symbols tends to be quite large, so if you&#8217;re looking for just one symbol, you probably want to grep it out.<\/p>\n<pre>dumpbin \/linkermember:2 libcmt.lib | findstr \/i printf\r\n<\/pre>\n<p>Note that the names are printed raw, with no undecorating.<\/p>\n<p><b>Bonus chatter<\/b>: The <code>DUMPBIN<\/code> program is really just a wrapper. All it does is run <code>LINK.EXE<\/code> with the <code>\/DUMP<\/code> command line option, followed by whatever options you passed to <code>DUMPBIN<\/code>. If you want, you can just go directly to <code>LINK.EXE<\/code>:<\/p>\n<pre>link \/dump \/linkermember mystery.lib\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>A tool hiding inside another tool.<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[25],"class_list":["post-109905","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-code"],"acf":[],"blog_post_summary":"<p>A tool hiding inside another tool.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/109905","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=109905"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/109905\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/111744"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=109905"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=109905"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=109905"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}