title: QT how to include a header and cpp file
body: <p>I have a qt project that is setup like this</p>
  
  <p>headers</p>
  
  <pre><code>mainwindow.h
  </code></pre>
  
  <p>source</p>
  
  <pre><code>main.cpp
  mainwindow.cpp
  </code></pre>
  
  <p>in the mainwindow.h</p>
  
  <pre><code>just some function prototypes no includes
  </code></pre>
  
  <p>in the mainwindow.cpp</p>
  
  <pre><code>#include "mainwindow.h"
  some code
  </code></pre>
  
  <p>in the main.cpp </p>
  
  <pre><code>#include "mainwindow.h"
  </code></pre>
  
  <p>This seems to work and is how the qt IDE setup the program</p>
  
  <p>Now I wanted to add a separate .h and .cpp program for some functions</p>
  
  <p>animationfunctions.h</p>
  
  <pre><code>#ifndef ANIMATIONFUNCTIONS_H
  #define ANIMATIONFUNCTIONS_H
  
  QPropertyAnimation* animationbuttonleft(QPushButton* guiitem, QString location, int startposition);
  
  #endif // ANIMATIONFUNCTIONS_H
  </code></pre>
  
  <p>animationfunctions.cpp</p>
  
  <pre><code>#include "animationfunctions.h"
  
  QPropertyAnimation* animationbuttonleft(QPushButton* guiitem, QString location, int startposition)
  {
  //
  }
  </code></pre>
  
  <p>mainwindow.cpp</p>
  
  <pre><code>#include "mainwindow.h"
  #include "ui_mainwindow.h"
  #include "animationfunctions.h"
  </code></pre>
  
  <p>I thought this would work but it did not. I tried a lot of different include combinations, but I always get a lnk 2019 error with unresolved external symbol of the QPropertyAnimation* animationbuttonleft</p>
  
  <p>I am wondering how I should set this up?</p>
  
  <p>here is the relevant part of my .pro file</p>
  
  <pre><code>SOURCES += \
          main.cpp \
          mainwindow.cpp \
      animationfunctions.cpp
  
  HEADERS += \
          mainwindow.h \
      xcash_wallet_2.rc \
      animationfunctions.h    
  </code></pre>
  
  <p>Thanks</p>