title: mingw building error: undefined reference to `__chkstk_ms'
body: <p>I've just installed mingw in windows, and I write a helloWorld program to test it. Code:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main(){
      printf("hello, world!\n");
      return 0;
  }
  </code></pre>
  
  <p>Result:</p>
  
  <pre><code>C:/MinGW/lib/crt2.o:crt1.c:(.text+0x1f1): undefined reference to `__chkstk_ms'
  C:/MinGW/lib/libmingwex.a(glob.o):glob.c:(.text+0x5e3): undefined reference to `__chkstk_ms'
  C:/MinGW/lib/libmingwex.a(glob.o):glob.c:(.text+0x690): undefined reference to `__chkstk_ms'
  C:/MinGW/lib/libmingwex.a(glob.o):glob.c:(.text+0x7e9): undefined reference to `__chkstk_ms'
  C:/MinGW/lib/libmingwex.a(glob.o):glob.c:(.text+0x82d): undefined reference to `__chkstk_ms'
  C:/MinGW/lib/libmingwex.a(glob.o):glob.c:(.text+0xc0d): more undefined references to `__chkstk_ms' follow
  </code></pre>
  
  <p>There is a similar question asked <a href="https://stackoverflow.com/questions/18649173/how-to-solve-undefined-reference-to-chkstk-ms-on-mingw">here</a>. But I checked the MinGW installation manager and it seems taht I didn't install old version of gcc or g++. Can any buddy help? Thanks!</p>
  
  <p>By the way, since I'm using pythonxy as my python environment, there is also a C:/MinGW32-xy directory under my C:, which is not included in the system variable 'path'. Would that affect? </p>