title: C++ redefinition with include guard and #pragma once
body: <p>So I'm new to the concept of header files. As far as I understand stuff gets defined in the header and then implemented/used in the *.cpp file. It now cannot build and is giving me Semantic Issues <code>"redefinition of '//*literally everything*//'"</code></p>
  
  <p>What I do now is </p>
  
  <pre class="lang-cpp prettyprint-override"><code>//move.hpp
  #pragma once
  #ifndef MOVE_HPP
  #define MOVE_HPP
  
  #include &lt;stdio.h&gt;
  
  class Move
  {
      private:
          int stolen;
  
      public:
          Move(int _stolen);
          int get_stolen();
  };
  #endif /* move_hpp */
  
  
  //----------------------------------------
  
  //move.cpp
  #include "move.hpp"
  
  int Move::get_stolen()
  {
      return stolen;
  }
  Move::Move(int _stolen)
  {
      this-&gt;stolen = _stolen;
  }
  </code></pre>
  
  <p>So what I am doing here is saying what variables and functions Move has, right? Well, I copied my approach more or less from a post describing how to use headers, yet in the move.cpp i get a "Redifinion of 'functionname'" for all of my methods where I give them a body in the *.cpp. So my question is: Am I using headers right and what am I to do to fix the Redefinition error?</p>
  
  <p>edit: when I wrote this I forgot i included this file somwhere else, when I remove that include I don't have any issues but the now used objects that don't exist without the inclide</p>