title: CodeRunner-- cannot compile multiple source c++ program
body: <p>I am very new at c++ programming and programming in general. Recently we've been adding header files and other source files (implementation) to our programs in class. I've tried writing the simplest of programs to make sure I understand the basics for including multiple files into one program but they will not compile, giving me linker errors.</p>
  
  <p>namely:</p>
  
  <pre><code>Undefined symbols for architecture x86_64:
    "FooBar::printSomething()", referenced from:
        _main in main-d52d70.o
  ld: symbol(s) not found for architecture x86_64
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  </code></pre>
  
  <p>When I compile in the terminal with "g++ main.cpp implementation.cpp", everything works just fine.</p>
  
  <p>my code:</p>
  
  <p><strong>main.cpp</strong></p>
  
  <pre><code>#include "header.h"
  
  int main()
  {
      FooBar object;
      object.printSomething();
      return 0;
  }
  </code></pre>
  
  <p><strong>header.h</strong></p>
  
  <pre><code>#ifndef _Header_h_
  #define _Header_h_
  
  #include &lt;iostream&gt;
  
  using namespace std;
  
  class FooBar{
      public:
          void printSomething();
  
      private:
          string helloWorld;
  };
  
  #endif
  </code></pre>
  
  <p><strong>implementation.cpp</strong></p>
  
  <pre><code>#include "header.h"
  
  void FooBar::printSomething(){
      helloWorld = "Hello World!\n";
      cout &lt;&lt; helloWorld;
  }
  </code></pre>
  
  <p>I love CodeRunner but this is really frustrating me.</p>
  
  <p>Thank you!</p>