title: Use GCC as the Default MEX Compiler for MATLAB 2014a on a 64 bit Windows 7 machine
body: <p>I am looking for a simple way to compile Unix MEX files on a Windows 7 computer.</p>
  
  <p>The MEX files compile smoothly in MATLAB 2014a on Mac OS X 10.9 (using "XCode with Clang" as the compiler). Some of the people that I work with, however, are having trouble compiling them in Windows 7 using the C compiler from the Windows 7.1 SDK. </p>
  
  <p>I understand that I might be able to avoid these errors if I use GCC to compile MEX files in MATLAB. I am wondering if anyone knows how. I am happy to download and edit whatever files are necessary so that I can a) compile MEX files within MATLAB by using the "MEX" command and b) guarantee that "-I" and "-L" instructions will also passed to the MEX compiler.</p>
  
  <p>Note, my issue is very similar <a href="https://stackoverflow.com/questions/8552580/using-gccmingw-as-matlabs-mex-compiler">to this post from 2+ years ago</a>. That said, I have put up a new post since a) MATLAB/MinGW/MEX have all had significant updates since then (not even sure if MinGW is the easiest way out of this mess); b) there is a 64 bit thing (not sure if it's a problem) and c) the "-I" and "-L" options are important.</p>