title: Geany - undefined reference
body: <p>I am trying to compile C++ code with Geany.</p>
  
  <p>Compile command: g++ -Wall -c "%f"</p>
  
  <p>Build command: g++ -Wall -o "%e" "%f"</p>
  
  <p>main.cpp:</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  #include "Person.hpp"
  
  int main()
  {
      Person p1(16);
  
      std::cout &lt;&lt; p1.getAge();
  
      return 0;
  }
  </code></pre>
  
  <p>Person.hpp</p>
  
  <pre><code>class Person
  {
  public:
  
      Person(int a);
  
      void setAge(int);
  
      int getAge() const;
  
  private:
  
      int age;
  };
  
  inline int Person::getAge() const
  {
      return age;
  }
  </code></pre>
  
  <p>Person.cpp</p>
  
  <pre><code>#include "Person.hpp"
  
  Person::Person(int a)
  {
      age = a;
  }
  
  void Person::setAge(int a)
  {
      age = a;
  }
  </code></pre>
  
  <p>Error:</p>
  
  <blockquote>
    <p>g++ -Wall -o "main" "main.cpp" (in directory:
    /home/me/projects/Test) /tmp/ccxYmWkE.o: In function <code>main':
    main.cpp:(.text+0x15): undefined reference to</code>Person::Person(int)'
    collect2: error: ld returned 1 exit status Compilation failed.</p>
  </blockquote>
  
  <p>Before Geany, I only used Code::Blocks and everything worked fine. How can I fix it?</p>