title: C++ Header file "symbol(s) not found" error with classes
body: <p>Learning C++, I've looked around quite a bit and every time I seem to get a different answer that doesn't work, perhaps I'm just missing something.</p>
  
  <p>I receive the following error:</p>
  
  <pre><code>"/Applications/CLion EAP.app/Contents/bin/cmake/bin/cmake" --build /Users/*/Library/Caches/clion10/cmake/generated/d7f7e267/d7f7e267/Debug --target hench_modules -- -j 8
  Scanning dependencies of target hench_modules
  [100%] Building CXX object CMakeFiles/hench_modules.dir/main.cpp.o
  Linking CXX executable hench_modules
  Undefined symbols for architecture x86_64:
  "Console::log(std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt;)", referenced from:
  _main in main.cpp.o
  ld: symbol(s) not found for architecture x86_64
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  make[3]: *** [hench_modules] Error 1
  make[2]: *** [CMakeFiles/hench_modules.dir/all] Error 2
  make[1]: *** [CMakeFiles/hench_modules.dir/rule] Error 2
  make: *** [hench_modules] Error 2
  </code></pre>
  
  <p>I'm using the JetBrains IDE "CLion"</p>
  
  <p>Below is my code:</p>
  
  <p>main.cpp:</p>
  
  <pre><code>//in main.cpp
  #include "Console/console.h"
  
  int main() {
      Console a; // no longer produces an error, because MyClass is defined
      a.log("Hello World!");
  }
  </code></pre>
  
  <p>console.h:</p>
  
  <pre><code>#include &lt;string&gt;
  class Console {
      public:
          void log(std::string str);
  };
  </code></pre>
  
  <p>console.cpp:</p>
  
  <pre><code>#include "console.h"
  #include &lt;iostream&gt;
  using namespace std;
  
  void Console::log(string str){
      cout &lt;&lt; str &lt;&lt; endl;
  };
  </code></pre>
  
  <p>Any help is appreciated, the error only appears when actually calling <code>a.log();</code>, prior to that there are no issues. As you can see the code is pretty simple and just following along a generic guide.</p>