title: how to link Qt with a visual studio c++ application project?
body: <p>I have Qt 5.12.0 in a folder.
  I need to create a dll and/or a bin project that can connect with a QML program.
  My problem is that the vs project can't find the Qt files I need. </p>
  
  <pre class="lang-cpp prettyprint-override"><code>#include &lt;QGuiApplication&gt;
  </code></pre>
  
  <p>does not work. </p>
  
  <p>This topic is the continuity of this one 
  <a href="https://stackoverflow.com/questions/55809004/how-to-link-libraries-to-a-project-on-visual-studio">How to link libraries to a project on visual studio?</a> where I shared my problems with linking my dll with my bin project and to link Qt.</p>
  
  <p>So I use a batch file to set the environment variable before launching visual studio. I use these variables to get the path to the Qt include folder, Qt lib etc.</p>
  
  <p>Here is what I tried.
  include the directory that contains the headers I need (I guess) :
  <em>configuration properties -> C/C++ -> General -> other include directories ->$(QT_INC)/</em>. QT_INC is the path to the include folder. I also tried to write $(QT_INC)/* and $(QT_INC)/QtGui/. In any case, </p>
  
  <pre class="lang-cpp prettyprint-override"><code>#include &lt;QGuiApplication&gt;
  </code></pre>
  
  <p>couldn't compile.</p>
  
  <p>i also added the path to the library folder :
  <em>linker->General->Additional library directories->$(QT_LIB)/</em> 
  and some lib files in :
  <em>linker->entry->additionnal dependencies->Qt5Quick.lib;Qt5Gui;lib;Qt5Core.lib</em>
  none of these steps creates any error. It just doesn't help to find QGuiApplication.h nor QObject or anything I need.</p>
  
  <p>I know my paths are correct and that using the environment variable like this works as I linked my dll using this method, and because wrong paths generates errors.</p>
  
  <p>How to add Qt to my solution or to a project ?</p>
  
  <p>thanks in advance</p>