Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I encountered the same error ("LNK2019: unresolved external symbol ...."). My headers and calls were defined correctly, and it only failed to link in Debug mode (no complaints in Debug mode). It turned out that my issue was caused by an incorrect <code>.vcxproj</code> file.</p> <p>When I added new dependencies to my project by editing the <code>vxcproj</code> file, I made a mistake: I thought that the two sections were identical except for the file extension, so I copy-pasted two lines from the first <code>&lt;ItemGroup&gt;</code> to the last <code>&lt;ItemGroup&gt;</code> (see below).</p> <p>It went unnoticed for a while, because I used a batch script to compile the code in <strong>Release</strong> mode. When I switched to <strong>Debug</strong> mode, the project failed at the linking stage. Ultimately, I discovered my error, and resolved the problem with the following patch:</p> <pre class="lang-diff prettyprint-override"><code>- &lt;ClCompile Include="crypto/crypto.h" /&gt; - &lt;ClCompile Include="crypto/rsa_public_key.h" /&gt; + &lt;ClInclude Include="crypto/crypto.h" /&gt; + &lt;ClInclude Include="crypto/rsa_public_key.h" /&gt; </code></pre> <p>Buggy version of the <code>.vcxproj</code> file: </p> <pre><code> &lt;ItemGroup&gt; ... &lt;ClCompile Include="main.cpp" /&gt; &lt;ClCompile Include="crypto/crypto.cpp" /&gt; &lt;ClCompile Include="crypto/rsa_public_key.cpp" /&gt; &lt;/ItemGroup&gt; &lt;ItemGroup&gt; &lt;None Include="main.def" /&gt; &lt;/ItemGroup&gt; &lt;ItemGroup&gt; ... &lt;ClInclude Include="main.h" /&gt; &lt;ClCompile Include="crypto/crypto.h" /&gt; &lt;ClCompile Include="crypto/rsa_public_key.h" /&gt; &lt;/ItemGroup&gt; &lt;Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /&gt; &lt;ImportGroup Label="ExtensionTargets"&gt; &lt;/ImportGroup&gt; &lt;/Project&gt; </code></pre> <p>Bottom line: When you get LNK2019 and none of the explanations on the internet help, check your project settings. If you use version control, compare the current project file with a known-good older version.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload