title: Undefined reference error at class instantiation
body: <p>This is my <strong>main.cpp</strong>. My program starts here and this is where I have the problem:</p>
  
  <p>I get two errors:</p>
  
  <p><em>undefined reference to `BankController::BankController(TransactionRepository</em>)* at line 23</p>
  
  <p>and</p>
  
  <p><em>undefined reference to `TransactionFileRepository::TransactionFileRepository(std::string)</em> at line 19</p>
  
  <p>For both of them, the type is C/C++ Problem, resource is main.cpp</p>
  
  <blockquote>
  <pre><code>#include "bankgui.h"
  #include "Controller/BankController.h"
  #include "Repository/TransactionFileRepository.h"
  #include "Repository/TransactionMemoryRepository.h"
  #include "Repository/TransactionRepository.h"
  
  #include &lt;QtGui&gt;
  #include &lt;QApplication&gt;
  #include &lt;string&gt;
  #include &lt;iostream&gt;
  using namespace std;
  
  int main(int argc, char *argv[]){
  
    string path = "DataStorage/Database.txt";
  
    //Instantiate the main data repository
    TransactionRepository* mainDatabase;
    mainDatabase = new TransactionFileRepository(path); // &lt;-- Error here
  
    //Instantiate the main controller
    BankController* mainController;
    mainController = new BankController(mainDatabase); // &lt;-- Same Error here
  
    //Starts the GUI
    QApplication app(argc, argv);
    BankGUI* mainWidget;
    mainWidget = new BankGUI(mainController);
    mainWidget-&gt;show();
  
    return app.exec();
  }
  </code></pre>
  </blockquote>
  
  <p>I have 3 classes:</p>
  
  <ul>
  <li><p>a virtual <strong>TransactionRepository</strong></p></li>
  <li><p>one class that implements the above <strong>TransactionMemoryRepository</strong></p></li>
  <li><p>one class that inherits the above <strong>TransactionMemoryRepository</strong> into <strong>TransactionFileRepository</strong></p></li>
  </ul>
  
  <p>I've been searching for several hours on google for solutions but everything I try doesn't get rid of those errors.</p>
  
  <p>I should mention that this is a C++ QT project that I am working on. I had to add to the project properties the include paths for some things to work.</p>
  
  <p>All files that are #included exist.</p>