If UAC (User Account Control) is turned on Windows 7, the MinGW support package might say success, but the compiler may not be there and mex won't find it. The reason for this is that xcopy silently fails due to UAC being turned on.
Resolution is to turn off UAC. Please follow the below link to turn off UAC:
Best Answer