title: Trouble with using header and source files
body: <p>I am trying to learn how to use header/source files in c++ programs, but I have been unable to get even a very basic program to compile properly. When I try to compile, I get errors such as "expected unqualified-id" or "use of undeclared identifier"</p>
  
  <p>This is all I have in my header file (project5functions.h):</p>
  
  <pre><code>#ifndef project5functions_h
      #define project5functions_h
  
      #include &lt;iostream&gt;
      #include &lt;fstream&gt;
  
              std::int testing123(std::int a);
  #endif
  </code></pre>
  
  <p>The associated project5functions.cpp:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include "project5functions.h"
  
  using namespace std;
  int testing123(int a) {
              return a + 4;
      }
  </code></pre>
  
  <p>And my main c++ file that I try to compile: </p>
  
  <pre><code>#include &lt;iostream&gt;
      #include "project5functions.h"
  
      using namespace std;
  
      int main () {
              cout &lt;&lt; testing123(7) &lt;&lt; endl;
  
              return 0;
      }
  </code></pre>
  
  <p>I honestly have no clue what could be causing the problem since most of the answers I found online had to do with syntax of declaring classes, which is above my level. Any help is greatly appreciated!</p>
  
  <p>Here is a screenshot of the compilation </p>
  
  <p><a href="https://i.stack.imgur.com/oA3Ev.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oA3Ev.png" alt="errors"></a></p>
  
  <p>As a side note, I was able to get it working by simply pasting the entire from the .cpp file to the .h file and adding <code>using namespace std</code>, but I have heard that this isn't the recommended method. Why is that?</p>