So the problem arises, when I tried to create mex files with my matlab. In order to do so successfully, I needed a c++ compiler on my windows 8 machine but I didn't want to install Visual Studio (as it takes around 10GB of memory).
So here is the pathway, I followed to get it done.
After installing this, the only thing left was to include path of win-builds to windows Environment variables under following name 'MW_MINGW64_LOC ' (that's the variable matlab use to search for c++ compiler). So I used following steps
1. Select Computer from the Start menu.
2. Choose System properties from the context menu.
3. Click Advanced system settings > Advanced tab.
4. Click Environment Variables.
5. Under System variables, select New.
6. In the New System Variable dialog box, type MW_MINGW64_LOC in the Variable name field.
7. In the Variable value field, type the location of the 'win-builds' installation, for example, C:\win-builds
8. Click Ok to close the dialog boxes, then close the Control Panel dialog box.
After all these steps, I was successfully able to create mex files from c files with my matlab :)