unresolved external symbol _MsiLocateComponentW@12 : <p>I know that simply posting code and asking for a solution isn't a good idea, but I have no idea what's causing this.</p>

<p>I'm trying to find the installation path of PowerPoint based on <a href="https://docs.microsoft.com/en-us/previous-versions/office/troubleshoot/office-developer/find-office-installation-path" rel="nofollow noreferrer">this code</a>, however, the compiler gives this error:</p>

<pre><code>error LNK2019: unresolved external symbol _MsiLocateComponentW@12 referenced in function _WinMain@16
</code></pre>

<p>I'm using Visual Studio 2019 and IntelliSense doesn't notice the error, only the compiler. Here's the code:</p>

<pre class="lang-cpp prettyprint-override"><code>#include &lt;Windows.h&gt;
#include &lt;msi.h&gt;

int APIENTRY WinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPSTR lpCmdLine, _In_ int nShowCmd) {
    LPCWSTR PowerPoint = L"{CC29E94B-7BC2-11D1-A921-00A0C91E2AA2}";

    DWORD size = 300;
    INSTALLSTATE installstate;
    LPWSTR sPath;

    sPath = new wchar_t[size];
    installstate = MsiLocateComponent(PowerPoint, sPath, &amp;size);

    if (installstate == INSTALLSTATE_LOCAL || installstate == INSTALLSTATE_SOURCE)
        MessageBox(NULL, sPath, L"PowerPoint path", MB_OK | MB_ICONASTERISK );
    delete[] sPath;
    return 0;
}
</code></pre>

<p>As you can see, I included the <code>msi.h</code> header. What's wrong with my code?</p>
