title: Configuring Qt project settings in MSVC
body: <p>I'm trying to add some network functionality to an existing Qt application, for which I have a working MSVC project file. My starting point for this was the <a href="http://doc.qt.io/qt-5/qtnetwork-fortuneserver-example.html" rel="nofollow">'fortune server'</a> networking example that is provided with the Qt installation. I have no problem getting this to compile in Qt Creator, but in MSVC it fails. To get a working MSVC project I had to use the Qt plugin and import the Qt Creator .pro file. This also works, but the issue I have is that I need to modify my existing Qt project to make the 'fortune server' example compile within it. After pouring over all the project settings I cannot find where the relevant differences between the working and non-working projects are.</p>
  
  <p>I figure the missing settings have to be the equivalent of what is expressed in the .pro file, which isn't much:</p>
  
  <pre><code>QT += network widgets
  
  HEADERS       = server.h
  SOURCES       = server.cpp \
                  main.cpp
  
  # install
  target.path = $$[QT_INSTALL_EXAMPLES]/network/fortuneserver
  INSTALLS += target
  </code></pre>
  
  <p>The compiler errors I get are basic include statements failing,  like:</p>
  
  <pre><code>#include &lt;QtWidgets&gt;
  </code></pre>
  
  <p>because it can't find the file/directory.</p>
  
  <p>I could fix that by adding a ton of include statements (modified server.cpp from the example):</p>
  
  <pre><code>#include &lt;QtWidgets/QWidget&gt;
  #include &lt;QtNetwork/QtNetwork&gt;
  #include &lt;QtWidgets/QLabel&gt;
  #include &lt;QtWidgets/QPushButton&gt;
  #include &lt;QtWidgets/QHBoxLayout&gt;
  #include &lt;QtGui/QGuiApplication&gt;
  #include &lt;QtNetwork/QTcpServer&gt;
  #include &lt;QtNetwork/QNetworkSession&gt;
  #include &lt;QtGui/QStyleHints&gt;
  #include &lt;QtWidgets/QGroupBox&gt;
  #include &lt;QtWidgets/QMessageBox&gt;
  </code></pre>
  
  <p>(With the working project I don't need all those explicit inclusions of all the classes)</p>
  
  <p>However, it still doesn't compile and I get lots of errors along the lines of:</p>
  
  <pre><code>Error   2   error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl qt_assert(char const *,char const *,int)" (__imp_?qt_assert@@YAXPBD0H@Z) referenced in function "public: class QObjectData * __thiscall QScopedPointer&lt;class QObjectData,struct QScopedPointerDeleter&lt;class QObjectData&gt; &gt;::operator-&gt;(void)const " (??C?$QScopedPointer@VQObjectData@@U?$QScopedPointerDeleter@VQObjectData@@@@@@QBEPAVQObjectData@@XZ)  c:\Users\xxx\documents\visual studio 2013\Projects\servertest\servertest\moc_server.obj 
  </code></pre>
  
  <p>Since I know that the code should work I feel like there ought to be something trivial I'm missing.</p>
  
  <p>Thanks</p>