title: Running C++ executables compiled in Cygwin on Windows
body: <p><strong>The Idea</strong><br />
  I've compiled a C++ exe using G++ on Cygwin, and I want to be able to get the output of that exe into my HTML via PHP. That is, let's say I have a C++ executable "test.exe" which outputs "Hello, World!" when run. Then logically, I should be able to do</p>
  
  <pre><code>&lt;?=exec("./test.exe")?&gt;
  </code></pre>
  
  <p>To send the output of the test.exe file to the file.</p>
  
  <p><strong>The Issue</strong><br />
  I'm testing this on a local WAMP server on Win7. Apparently, <code>exec</code> and <code>system</code> calls on Win7 WAMP go through the Windows command prompt, meaning it's running batch instead of bash. For some reason, batch doesn't like Cygwin-compiled executables, giving the error:<Br /></p>
  
  <blockquote>
    <p>"The program can't start because cygwin1.dll is missing from your
    computer. Try reinstalling the program to fix this problem."</p>
  </blockquote>
  
  <p>So, how can I make it so windows batch can execute cygwin-compiled files?</p>