title: Everytime I'm going to use external sources I get: collect2. exe: error ld returned 1 exit status
body: <p>For example this code, I create a new project in codeblocks, add these files, enable the header file and when trying to run it i get:</p>
  
  <p>-------------- Build: Debug in date (compiler: GNU GCC Compiler)---------------</p>
  
  <blockquote>
    <p>mingw32-g++.exe -Wall -fexceptions -g -std=c++11 -I..\date -c
    "C:\Users\kairenne\Documents\programming\chapter
    8\monster_generation\date\main.cpp" -o obj\Debug\main.o
    mingw32-g++.exe  -o bin\Debug\date.exe obj\Debug\Date.o Date.h.gch
    obj\Debug\main.o    Date.h.gch: file not recognized: File format not
    recognized collect2.exe: error: ld returned 1 exit status Process
    terminated with status 1 (0 minute(s), 1 second(s)) 1 error(s), 0
    warning(s) (0 minute(s), 1 second(s))</p>
  </blockquote>
  
  <p>Date.h</p>
  
  <pre><code>#define DATE_H
  
  class Date
  {
  private:
      int m_year;
      int m_month;
      int m_day;
  
  public:
      Date(int year, int month, int day);
  
      void SetDate(int year, int month, int day);
  
      int getYear() { return m_year; }
      int getMonth() { return m_month; }
      int getDay()  { return m_day; }
  };
  
  #endif
  </code></pre>
  
  <p>Date.cpp</p>
  
  <pre><code>
  // Date constructor
  Date::Date(int year, int month, int day)
  {
      SetDate(year, month, day);
  }
  
  // Date member function
  void Date::SetDate(int year, int month, int day)
  {
      m_month = month;
      m_day = day;
      m_year = year;
  }
  </code></pre>
  
  <p>Main.cpp</p>
  
  <pre><code>#include "Date.h"
  
  using namespace std;
  
  int main()
  {
      Date test(2000, 05, 10);
      return 0;
  }
  
  
  
  
  
  </code></pre>