title: Using .c and .cpp files in Visual Studio at the same time
body: <p>Trying to figure out how to get an application to compile that uses both C and C++ files. Not the entire code, but enough to get the idea:</p>
  
  <p>main.cpp:</p>
  
  <pre><code>#include &lt;windows.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  #include "one.h"
  #include "two.h"
  
  int __stdcall WinMain(HINSTANCE hInst, HINSTANCE hInst2, LPSTR lpCmdLine, int nShowCmd) {
      FunctionOne();
      FunctionTwo();
  }
  </code></pre>
  
  <p>one.cpp:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;windows.h&gt;
  #include &lt;gdiplus.h&gt;
  #include &lt;gdiplusflat.h&gt;
  using namespace Gdiplus;
  using namespace Gdiplus::DllExports;
  
  int FunctionOne() {
  }
  </code></pre>
  
  <p>two.c</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;windows.h&gt;
  
  int FunctionTwo() {
  }
  </code></pre>
  
  <p>The header files contain only definitions for those functions.</p>
  
  <p>Now, if I compile this with a <strong>main.cpp</strong>, I get an "unresolved external symbol" for FunctionTwo. If I compile this with a <strong>main.c</strong>, I get the same thing for FunctionOne. Is this even possible, and if so, how would I set up the project to compile properly (Visual Studio 2010)?</p>
  
  <p>It compiles fine if I comment out the alternate function depending on the extension for main.</p>
  
  <p>Thanks!</p>