title: C++ QT5 LNK 2019 unresolved external symbol (unit test)
body: <p>I am trying to unit test my application but i wont get it work.</p>
  
  <p>I habe 2 .pro files. One in my "main" project and one in "Unittest".</p>
  
  <p>My Folder structure is :</p>
  
  <pre><code>offline_ip_adress_calculator
  ├───updater
  │   └───updater
  ├───classes
  │   ├───ip_calculator
  │   └───threads
  ├───image
  └───tests
      └───Unittest
          └───ip_calculator
  </code></pre>
  
  <p>Unittest .pro file:</p>
  
  <pre><code>TargetDirectory = C:\build\unit_test
  
  CONFIG(debug, debug|release) {
      DESTDIR = $$TargetDirectory\debug
      OBJECTS_DIR = $$TargetDirectory\debug\.obj
      MOC_DIR = $$TargetDirectory\debug\.moc
      RCC_DIR = $$TargetDirectory\debug\.rcc
      UI_DIR =  $$TargetDirectory\debug\.ui
  } else {
      DESTDIR = $$TargetDirectory\release
      OBJECTS_DIR = $$TargetDirectory\release\.obj
      MOC_DIR = $$TargetDirectory\release\.moc
      RCC_DIR = $$TargetDirectory\release\.rcc
      UI_DIR =  $$TargetDirectory\release\.ui
  }
  
  QT  += testlib
  QT  += core
  
  
  INSTALLS += target sources
  
  CONFIG += c++11
  
  
  TARGET = maintest
  
  # Change this Path
  INCLUDEPATH += X:/ip_adress_calculator/offline_ip_adress_calculator
  
  TEMPLATE = app
  
  SOURCES += \
      qtestqstring.cpp \
      ip_calculator/qttestcomboxone.cpp \
      main.cpp
  
  HEADERS += \
      qtestqstring.h \
      ip_calculator/qttestcomboxone.h
  </code></pre>
  
  <p>My unit test class:</p>
  
  <pre><code>#ifndef QTTESTCOMBOXONE_H
  #define QTTESTCOMBOXONE_H
  
  #include &lt;QObject&gt;
  #include &lt;QtTest/QTest&gt;
  
  
  #include "classes/ip_calculator/comboxone.h"
  
  class QtTestComboxOne : public QObject
  {
      Q_OBJECT
  
  private slots:
      void QtTestCalculateIndustrialSwitchOne();
  
  public:
      explicit QtTestComboxOne(QObject *parent = 0);
  
  signals:
  
  public slots:
  
  };
  
  #endif // QTTESTCOMBOXONE_H
  
  
  #include "qttestcomboxone.h"
  
  QtTestComboxOne::QtTestComboxOne(QObject *parent) :
      QObject(parent)
  {
  }
  
  
  
  
  void QtTestComboxOne::QtTestCalculateIndustrialSwitchOne()
  {
      ComboxOne combox_one;
  
      combox_one.setCommunicationNumber(1);
      QCOMPARE(combox_one.calculate(QString("industrial_switch_1")), QString("10.0.20.2"));
  }
  </code></pre>
  
  <p>ComboxOne class:</p>
  
  <pre><code>#ifndef COMBOXONE_H
  #define COMBOXONE_H
  
  #include "abstractipcalculator.h"
  
  class ComboxOne  : public AbstractIpCalculator
  {
  public:
      ComboxOne();
      QString calculate(QString);
  
  private:
      QString calculateOctetOne(QString);
      QString calculateOctetTwo(QString);
      QString calculateOctetThree(QString);
      QString calculateOctetFour(QString);
  };
  
  #endif // COMBOXONE_H
  </code></pre>
  
  <p>COmboxOne cpp:</p>
  
  <pre><code>#include "comboxone.h"
  
  ComboxOne::ComboxOne()
  {
      data_structure.enqueue(QPair&lt;QString, QString&gt;("industrial_switch_1", "Industrial Switch I"));
  }
  
  QString ComboxOne::calculate(QString name)
  {
      QString return_value;
  
      return_value.append(calculateOctetOne(name));
      return_value.append(".");
      return_value.append(calculateOctetTwo(name));
      return_value.append(".");
      return_value.append(calculateOctetThree(name));
      return_value.append(".");
      return_value.append(calculateOctetFour(name));
  
      return return_value;
  }
  
  QString ComboxOne::calculateOctetOne(QString name)
  {
      return [...];
  }
  
  QString ComboxOne::calculateOctetTwo(QString name)
  {
      [...]
      return QString::number(temp_res);
  }
  
  QString ComboxOne::calculateOctetThree(QString name)
  {
      [...]
      return QString::number(temp_res);
  }
  
  QString ComboxOne::calculateOctetFour(QString name)
  {
      [...]
      return QString("10");
  
  }
  </code></pre>
  
  <p>AbstractIpCalculator</p>
  
  <pre><code>#ifndef ABSTRACTIPCALCULATOR_H
  #define ABSTRACTIPCALCULATOR_H
  
  #include &lt;QString&gt;
  #include &lt;QDebug&gt;
  #include &lt;QPair&gt;
  #include &lt;QQueue&gt;
  
  
  class AbstractIpCalculator
  {
  public:
      QQueue&lt;QPair&lt;QString,QString&gt; &gt; data_structure;
  
      AbstractIpCalculator();
  
      bool setParkNetzId(int index, int value);
      void setCommunicationNumber(int communication_number);
      virtual QString calculate(QString) = 0;
  
  protected:
      QMap&lt;int, int&gt; park_netz_list;
      int communication_number;
      int getParkNetId();
  
      static const int bla_1 = 360;
      static const int bal_2 = 363;
  
  private:
      virtual QString calculateOctetOne(QString) = 0;
      virtual QString calculateOctetTwo(QString) = 0;
      virtual QString calculateOctetThree(QString) = 0;
      virtual QString calculateOctetFour(QString) = 0;
  };
  
  #endif // ABSTRACTIPCALCULATOR_H
  </code></pre>
  
  <p>Unit test Main</p>
  
  <pre><code>#include &lt;QTest&gt;
  #include "qtestqstring.h"
  #include "ip_calculator/qttestcomboxone.h"
  
  int main()
  {
      QTestQString string_test;
      QtTestComboxOne combox_one;
  
      QTest::qExec(&amp;string_test);
      QTest::qExec(&amp;combox_one);
  }
  </code></pre>
  
  <p>I get this error messages:</p>
  
  <pre><code>qttestcomboxone.obj:-1: Fehler:LNK2019: unresolved external symbol "public: virtual class QString __thiscall ComboxOne::calculate(class QString)" (?calculate@ComboxOne@@UAE?AVQString@@V2@@Z) referenced in function "private: void __thiscall QtTestComboxOne::QtTestCalculateIndustrialSwitchOne(void)" (?QtTestCalculateIndustrialSwitchOne@QtTestComboxOne@@AAEXXZ)
  
  qttestcomboxone.obj:-1: Fehler:LNK2019: unresolved external symbol "public: void __thiscall AbstractIpCalculator::setCommunicationNumber(int)" (?setCommunicationNumber@AbstractIpCalculator@@QAEXH@Z) referenced in function "private: void __thiscall QtTestComboxOne::QtTestCalculateIndustrialSwitchOne(void)" (?QtTestCalculateIndustrialSwitchOne@QtTestComboxOne@@AAEXXZ)
  
  qttestcomboxone.obj:-1: Fehler:LNK2019: unresolved external symbol "public: bool __thiscall AbstractIpCalculator::setParkNetzId(int,int)" (?setParkNetzId@AbstractIpCalculator@@QAE_NHH@Z) referenced in function "private: void __thiscall QtTestComboxOne::QtTestCalculateIndustrialSwitchOne(void)" (?QtTestCalculateIndustrialSwitchOne@QtTestComboxOne@@AAEXXZ)
  </code></pre>
  
  <p>I think the class "ComboxOne" can't find the parent class.</p>