title: How to add a class in Qt Creator with CMake project?
body: <p>I used to write code with Visual Studio, which is pretty easy to add a class. Recently, I turn to use Qt Creator to write pure C++ project and there are always something wrong with adding a class. The codes are like these:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include "hello.h"
  
  using namespace std;
  
  int main()
  {
      Hello H;
      H.say();
      cout &lt;&lt; "Hello World!" &lt;&lt; endl;
      return 0;
  }
  </code></pre>
  
  <p>I created a class named Hello and include it into the main.cpp, but when I compile it, some errors will happen.</p>
  
  <p><img src="https://i.stack.imgur.com/7fz7g.png" alt="enter image description here"></p>
  
  <p>So how to add a class with QT creator? Thanks in advance!</p>