title: Multiple Source .cpp Files Problems
body: <p>I've separated my large program into a number of .cpp files, e.g. display.cpp, gui.cpp, display.h, gui.h, etc... </p>
  
  <p>These files are separated just for readability, not necessarily indicative of any sort of dependency scheme. </p>
  
  <p>Initially I had a lot of trouble getting them to compile, because functions from display will call functions from gui, AND vice versa. Whichever one I include first, it will still depend on the other's functions. But I finally figured out that I need to first include all the .h files, then include all the .cpp files, in my main program. </p>
  
  <p>Example, in the main_program.cpp: </p>
  
  <pre><code>#include "display.h"
  #include "gui.h"
  #include "display.cpp"
  #include "gui.cpp"
  </code></pre>
  
  <p>Unfortunately I also realized that in order to compile I had to remove all the other .cpp files from what is considered "source" code in the Visual Studio debugger. That way it just compiles main_program.cpp, including the other files as needed. If I include display.cpp and gui.cpp in the "source" sidebar it will error. </p>
  
  <p>This is probably the wrong way of doing things and I feel like I am doing something wrong. I would like to be able to put all the source files in the sidebar and still have it compile. Of course the above was just an example and I have not two, but more like 10 different .cpp files that all call each others' functions. Please advise on how to better design this. </p>