title: 2019 link error - c++
body: <p>I wrote the following code snippet in VS2010:</p>
  
  <pre><code>#pragma once
  #include "stdafx.h"
  #ifndef SECURITY_WIN32
  #define SECURITY_WIN32
  #endif
  #include "windows.h"
  #include "sspi.h"
  
  int main( void )
  {
      ULONG cPackages = 0;
      PSecPkgInfo pInfo = NULL;
      SECURITY_STATUS stat = EnumerateSecurityPackages(&amp;cPackages, &amp;pInfo);
      if (stat == SEC_E_OK) 
      { 
          for (ULONG i = 0; i &lt; cPackages; i++) 
          { 
              wprintf(L"%s\t%s\n",pInfo[i].Name, pInfo[i].Comment); 
          } 
          FreeContextBuffer(pInfo); 
      } 
      return 0; 
  
  }
  </code></pre>
  
  <p>but, at the compile time I got the following errors:</p>
  
  <blockquote>
    <p>error LNK2019: unresolved external symbol
    _<em>imp</em>_EnumerateSecurityPackagesW@8 referenced in function _main</p>
  </blockquote>
  
  <p>and </p>
  
  <blockquote>
    <p>error LNK2019: unresolved external symbol _FreeContextBuffer@4
    referenced in function _main</p>
  </blockquote>
  
  <p>can anyone please help me?</p>