title: Why are all my C++ programs exiting with 0xc0000139?
body: <p>I am trying to teach myself to program in C++ and am using Cygwin on Windows with g++ installed.  Everything was going swimmingly until I started to declare string variables.  Using string literals with cout causes no issues, but as soon as I declare a string variable the program will no longer run.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  
  int main ()
  {
    std::string mystring = "Test";
    std::cout &lt;&lt; mystring;
    return 0;
  }
  </code></pre>
  
  <p>The preceding code compiles without issue, but when run produces no output.  GDB provides me with the following:</p>
  
  <pre><code>(gdb) run
  Starting program: /cygdrive/c/Projects/CPP Test/string.exe
  [New Thread 8416.0x2548]
  [New Thread 8416.0x2510]
  [New Thread 8416.0x1694]
  [New Thread 8416.0x14f4]
  [Thread 8416.0x1694 exited with code 3221225785]
  [Thread 8416.0x14f4 exited with code 3221225785]
  During startup program exited with code 0xc0000139.
  </code></pre>
  
  <p>From what I have managed to gather this is some sort of entry point issue with a DLL, but I could be completely wrong.</p>
  
  <p>Does anyone know what I have done wrong or what I have misconfigured and how to fix it?</p>