title: should I add the CPP files into *.pro when I trying to load the DLL
body: <p>I need to compile some source code into a DLL, and load it in other project.  I have an entry called</p>
  
  <pre><code>extern "C" LTCPOS_LSHARED_EXPORT tcpClient_Os* getClientInst(VhostInfo hostInfo, CtcpOpt *tcpOpt, QObject *parent = 0);
  </code></pre>
  
  <p>The type of "tcpClient_OS" is a self-defined class.  When I load the DLL using QLibrary in a different project it appears that I must add the <strong>source file (cpp files)</strong> into the *.pro in order to make the project compiled without errors.  Why?</p>
  
  <p>What is the normal routine of building a DLL with a function returning self-defined class pointer and how do I load it?</p>