title: MQTT LNK2019 unresolved external symbol "_imp_mosquitto_lib_init"
body: <p>I want to create a MQTT client with the mosquitto lib in Microsoft Visual Studio Community 2022 as a C++ console app.</p>
  <p>I installed mosquitto with this installer mosquitto-2.0.14-install-windows-x64.exe.</p>
  <p>So I get the following file structure.</p>
  <p><a href="https://i.stack.imgur.com/AmTKu.png" rel="nofollow noreferrer">mosquitto file structure</a></p>
  <p><a href="https://i.stack.imgur.com/2hlnh.png" rel="nofollow noreferrer">mosquitto file structure devel</a></p>
  <p>I added the following properties.</p>
  <p><a href="https://i.stack.imgur.com/bASap.png" rel="nofollow noreferrer">VC++ directories</a></p>
  <p><a href="https://i.stack.imgur.com/RQXXu.png" rel="nofollow noreferrer">Linker general</a></p>
  <p><a href="https://i.stack.imgur.com/BpJBg.png" rel="nofollow noreferrer">Linker input</a></p>
  <p>But I still get a linker error.</p>
  <p>LNK2019 unresolved external symbol &quot;_imp_mosquitto_lib_init</p>
  <p>This is the source code that cause the problem.</p>
  <pre><code>#include &lt;iostream&gt;
  #include &lt;mosquittopp.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;string.h&gt;
  // #include &lt;unistd.h&gt;
  
  int main()
  {
  
  int rc;
  struct mosquitto_message* msg;
  
  mosquitto_lib_init();
  </code></pre>
  <p>Can anybody advice how to solve the problem.</p>