title: Incomplete type error while using class from my own dll
body: <p>One more day, one more dumb question on stackoverflow, please excuse me.
  The idea was to make dll and then import it to another project to use it there, but after including dll header file in second project and writing paths to the .lib and header files I still have these errors:</p>
  <pre><code>E0070   incomplete type is not allowed  prjct-1 D:\projects-vs\firstTryWT\prjct-1\prjct-1.cpp   33
  C2027   use of undefined type 'stmr::MathProblem'   prjct-1 D:\projects-vs\firstTryWT\prjct-1\prjct-1.cpp   33
  C2079   'problem' uses undefined class 'stmr::MathProblem'  prjct-1 D:\projects-vs\firstTryWT\prjct-1\prjct-1.cpp   33  
  C3493   'problem' cannot be implicitly captured because no default capture mode has been specified  prjct-1 D:\projects-vs\firstTryWT\prjct-1\prjct-1.cpp   35  
  </code></pre>
  <p>I've tried to rebuild, change some code till I understand that I either already did what is needed or I don't know what is needed. Anyway, here is the code:</p>
  <p>Dll header file:</p>
  <pre><code>#pragma once
  
  #ifdef STMR_EXPORTS
  #define STMR_API __declspec(dllexport)
  #else
  #define STMR_API __declspec(dllimport)
  #endif
  
  #include &lt;vector&gt;
  #include &lt;string&gt;
  
  namespace stmr
  {
      class STMR_API MathProblem;
      class STMR_API Operation;
  }
  </code></pre>
  <p>Definitions of both classes have STMR_API keyword. I have 'STMR_EXPORTS' in C/C++ -&gt; Preprocessor and '$(OutDir)$(TargetName).lib' in Linker -&gt; Advanced -&gt; Import Library so that I have the import lib generated.</p>
  <p>main cpp of the project which is supposed to use the dll:</p>
  <pre><code>#include &lt;Wt/WApplication.h&gt;
  #include &lt;Wt/WBreak.h&gt;
  #include &lt;Wt/WContainerWidget.h&gt;
  #include &lt;Wt/WLineEdit.h&gt;
  #include &lt;Wt/WPushButton.h&gt;
  #include &lt;Wt/WText.h&gt;
  
  #include &quot;stmrLib.h&quot;
  
  
  class HelloApplication : public Wt::WApplication
  {
  public:
      HelloApplication(const Wt::WEnvironment&amp; env);
  
  private:
      Wt::WPushButton* button_m;
      Wt::WText* summary_m;
  };
  
  HelloApplication::HelloApplication(const Wt::WEnvironment&amp; env)
      : Wt::WApplication(env)
  {
      button_m = root()-&gt;addWidget(std::make_unique&lt;Wt::WPushButton&gt;());
      summary_m = root()-&gt;addWidget(std::make_unique&lt;Wt::WText&gt;()); 
      stmr::MathProblem problem = stmr::MathProblem(problemText_m-&gt;text().narrow());
      auto solving = [this] {   
          summary_m-&gt;setText(&quot;This equals &quot; + std::to_string(problem.solve()));
      };
      button_m-&gt;clicked().connect(solving);
  }
  
  int main(int argc, char** argv)
  {
      return Wt::WRun(argc, argv, [](const Wt::WEnvironment&amp; env) {
          return std::make_unique&lt;HelloApplication&gt;(env);
          });
  }
  </code></pre>
  <p>I have correct path to the .lib file for dll in Linker -&gt; General -&gt; Additional Library Dependencies and stmr.lib/stmrd.lib in Linker -&gt; Input -&gt; Additional Dependencies for Release/Debug
  Not sure if the problem in exporting or importing of the dll.</p>
  <p>Feedback about question quality is appreciated.</p>