In case anyone else has this problem, here's the fix:
- Uninstall .NET Framework 4 and above
- Uninstall SDK 7.1
- Uninstall visual studio 2010
- Reinstall visual studio 2010
- Install .NET Framework 4 (version 4.0.30319)
- Uninstall Visual Studio 2010 redistributable packages (x64 and 86)
- Reinstall SDK 7.1 (uncheck "Visual C++ compilers" and "microsoft visual C++ 2010" during reinstall)
- Install SDK 7.1 patch
- Install Visual Studio 2012 C++ Redistributable compilers (x64 and x86 version 11.0.61030)
- Install .NET Framework 4.6.1 (4.6.01055 version)
- Repair Visual Studio 2012 C++ compilers to be safe
- Restart computer
- set up the compiler in matlab (mex -setup and xpcsetCC)