{"id":4707,"date":"2014-03-30T14:49:43","date_gmt":"2014-03-30T14:49:43","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/unresolved-symbol-errors-within-dll-collection-of-common-programming-errors\/"},"modified":"2014-03-30T14:49:43","modified_gmt":"2014-03-30T14:49:43","slug":"unresolved-symbol-errors-within-dll-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/unresolved-symbol-errors-within-dll-collection-of-common-programming-errors\/","title":{"rendered":"Unresolved symbol errors within DLL-Collection of common programming errors"},"content":{"rendered":"<p>For background, I have come across this porting a medium-sized linux codebase (compiling into a giant .so) to x64 windows (compiling into a .dll). I have had linker trouble.<\/p>\n<p>As a minimal testcase, if I create a Visual Studio project from just the following file:<\/p>\n<pre><code>#include \n#include \n\nvoid do_stuff(char const * s)\n{\n  char buffer[4096];\n  long int len = UnDecorateSymbolName(\n    s,\n    buffer,\n    sizeof(buffer),\n    UNDNAME_COMPLETE);\n}\n<\/code><\/pre>\n<p>And I set the project type to DLL and build it, I get an error &#8220;LNK2001: Unresolved external symbol __imp_UnDecorateSymbolName&#8221;. That is, the file compiles properly, but fails to link into a dll.<\/p>\n<p>I think the goal is for my dll to link to dbghelp.dll, especially since (at least on my system) there is no such file as a dbghelp.lib. So why is it trying to resolve that symbol now, rather then when my DLL is loaded into an application? And why can&#8217;t it see that function anyhow?<\/p>\n<p>To be clear, I have confirmed that I am building the x64 DLL, and that the dbghelp.dll in C:\\Windows\\System32 is x64.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For background, I have come across this porting a medium-sized linux codebase (compiling into a giant .so) to x64 windows (compiling into a .dll). I have had linker trouble. As a minimal testcase, if I create a Visual Studio project from just the following file: #include #include void do_stuff(char const * s) { char buffer[4096]; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4707","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4707","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=4707"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4707\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=4707"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=4707"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=4707"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}