title: Visual Studio thinking that functions are already defined?
body: <p>I have two files for a project I'm working on, one of my own writing and one written by a fellow student to serve as a sort of API. My problem is, the functions that are defined in the resource file are causing linker errors in VS2012.</p>
  
  <p>I'm getting error <a href="http://msdn.microsoft.com/en-us/library/72zdcz6f.aspx" rel="nofollow">LNK2005</a>, which Microsoft defines as:</p>
  
  <blockquote>
    <p>symbol already defined in object</p>
    
    <p>The given symbol, displayed in its decorated form, was multiply defined.</p>
  </blockquote>
  
  <hr>
  
  <p>The three functions defined in the resource file, <code>ArgvFunctions.cpp</code>, are:</p>
  
  <pre><code>void convertCommandToArgv(char* commandString, char** argv[], int* argc);
  void freeDynamicallyAllocatedArgv(char* argv[], int argc);
  
  void doMain(int argc, char* argv[]);
  /* renamed from "main" to avoid error. is never called: only shows implementation */
  </code></pre>
  
  <p>and the <code>#includes</code> in my implementation file:</p>
  
  <pre><code>#include &lt;ios&gt;
  #include &lt;iostream&gt;
  #include &lt;fstream&gt;
  #include &lt;string&gt;
  #include &lt;vector&gt;
  
  #include "bmpfileheaders.h"  // no problems with this one
  #include "ArgvFunctions.cpp"
  </code></pre>
  
  <hr>
  
  <p>In case it helps: before I encountered this problem, I had to suppress errors raised by <code>ArgvFunctions.cpp</code> that were due to the fact that the functions therein use the versions of <code>strtok()</code> and <code>strncpy()</code> that Microsoft deprecated due to security issues (I'm making sure that nothing passed to the functions could trip them up, as nearly as I can tell, so those issues wouldn't be a problem either way; also, I don't have the time or the knowledge to replace <code>strtok()</code> with <code>strtok_s()</code> and et cetera).</p>
  
  <hr>
  
  <p>EDIT:</p>
  
  <p>whoops, turns out I know nothing about C++. Thanks, all.</p>