title: Error LNK2005: function already defined in MyForm.obj
body: <p>I'm trying to make a windows form application in Visual Studio C++, but I get this errors after compiling, for each function:</p>
  
  <blockquote>
    <p>error LNK2005: function already defined in MyForm.obj</p>
  </blockquote>
  
  <p>These are my files:</p>
  
  <p>Source.cpp</p>
  
  <pre><code>#pragma once
  #include "MyForm.h"
  using namespace System;
  using namespace System::Windows::Forms;
  
  [STAThread]//leave this as is
  void main() {
      Application::EnableVisualStyles();
      Application::SetCompatibleTextRenderingDefault(false);
      Application::Run(gcnew Project1::MyForm);
  }
  </code></pre>
  
  <p>MyForm.h</p>
  
  <pre><code>#pragma once
  #include &lt;iostream&gt;
  #include &lt;string&gt;
  #include "Header.h"
  
  namespace Project1 {
      //codes of te form
  }
  </code></pre>
  
  <p>Header.h</p>
  
  <pre><code>#pragma once
  #include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;cmath&gt;
  #include &lt;set&gt;
  #include &lt;algorithm&gt;
  using namespace std;
  int n, m;
  int size1, size2;
  //My functions here
  </code></pre>
  
  <p>So how can I fix errors?</p>