title: How to statically link the library for using SHGetSpecialFolderPath using cl.exe
body: <p>I am using the <code>SHGetSpecialFolderPath</code> function of the WINAPI, and also using the windows VisualExpressC++ compiler (cl.exe) to compile it. But when in linking stage I get this error:</p>
  
  <pre><code>error LNK2019: unresolved external symbol __imp___SHGetSpecialFolderPathA@16 referenced in function _main
  </code></pre>
  
  <p>I guess that I need to link <code>Shell32.lib</code>, is this correct and how would I do it in a way that I can actually get my program running on another system, maybe even a XP instead of a 7, without recompiling it?</p>