title: I can't figure out how to link msi.lib to my Visual Studio C++ project
body: <p>I'm trying to write a simple application that will enumerate all the ProductCodes installed on my machine.</p>
  
  <p>I've started a new project in Visual Studio 2013, but whenever I build I get the error:<br>
  <strong>"LNK2019: unresolved external symbol _MsiEnumProductsExA@32 referenced in function _main"</strong></p>
  
  <p>I've been trying to figure out how to add msi.lib to my project include path, but I can't seem to figure it out.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>#define _WIN32_MSI 300
  
  #include &lt;Windows.h&gt;
  #include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;Msi.h&gt;
  using namespace std;
  
  int main() {
      // Get a list of all installed MSIs
      DWORD index = 0;
      TCHAR currentProductCode[40] = {0};
      unsigned int result = ERROR_SUCCESS;
  
     // Open an MSI handle
     while (ERROR_SUCCESS == result) {
        result = MsiEnumProductsEx(NULL, "s-1-1-0",
                                   MSIINSTALLCONTEXT_USERMANAGED | MSIINSTALLCONTEXT_USERUNMANAGED | MSIINSTALLCONTEXT_MACHINE,
                                   index, currentProductCode, NULL, NULL, NULL);
        if (result == ERROR_SUCCESS) {
           cout &lt;&lt; "current ProductCode: " &lt;&lt; currentProductCode;
        }
        index++;
     }
  
      return 0;
  }
  </code></pre>
  
  <p>I've been trying to update the project's Property Pages by adding the path to the msi.lib to the "Library Directories" property, but that doesn't seem to work:
  <img src="https://i.stack.imgur.com/ONCog.png" alt="Property Page Screenshot"></p>
  
  <p>This is like Visual Studio 101, what am I missing?!</p>