How do I install Microsoft Visual C++ 2010 and Microsoft Windows SDK 7.1?

145 views (last 30 days)
I would like to know the specific steps needed to install both Microsoft Visual C++ 2010 Express or Professional and Windows SDK 7.1.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 13 Jul 2021
Edited: MathWorks Support Team on 13 Jul 2021
Here are the specific steps needed to install both Microsoft Visual C++ 2010 Express and Microsoft Windows SDK 7.1. Visual C++ 2010 Express is utilized as an example here, although the same steps are broadly applicable to installing Visual C++ 2010 Professional.
For MATLAB 7.12 (R2011a), both Visual C++ 2010 Express and SDK 7.1 must be installed to make a 64-bit compiler available on your computer. For future releases of MATLAB, only the SDK 7.1 is necessary.
*** Prerequisite Information ***
There exist a Windows SDK 7.1 bug that will cause errors during installation or compilation if Microsoft Visual C++ 2010 Express or Professional SP1 (or its redistributable packages) is also present (although it must be SP1 for this bug to surface, if you don't know whether you have SP1 or not, assume that you do).
Details on the bug can be found at:
To avoid this bug:
A. If you don't have either Visual C++ 2010 or SDK 7.1 installed or only have SDK 7.1 installed, follow the order below:
1. Install the SDK 7.1 first, if needed. If this fails, follow the steps in section B below, and then go to step 3 here.
2. Apply the patch from Microsoft below onto the SDK 7.1 installation:
3. Install the Visual C++ 2010 Express.
4. Upgrade Visual C++ 2010 Express to SP1 if needed.
B. If you have Visual C++ 2010 Express SP1 installed already, but not the Windows SDK 7.1:
1. Uninstall the Visual C++ 2010 Redistributable packages, both x64 and x86 versions. This can be done from the Control Panel > Uninstall Programs menu.
2. Install the SDK 7.1. During install of the SDK 7.1, make sure to uncheck 'Visual C++ Compilers' and 'Microsoft Visual C++ 2010' during installation options.
3. Apply the patch from Microsoft below onto the SDK 7.1 installation:
4. Reinstall the Visual C++ 2010 Redistributable packages:
x64 and x86 version:
C. If you have both installed already, and running into errors during compilation, apply the patch to the SDK 7.1 installation:
*** Install the Windows SDK 7.1 ***
1. Go to
and download Windows SDK for Windows 7 and .NET Framework 4.
2. When the download is complete, choose to run winsdk_web.exe. Depending on your security settings, you may be prompted by User Account Control (UAC) to confirm “making changes to this computer”.
3. After several seconds, the Setup Wizard will appear.
4. Click through the wizard, accepting the license agreement and not changing any of the installation folders.
ERROR: NOTE: When you get to the “Installation Options” page, if you have Visual C++ 2010 SP1 (Professional or Express) or its redistributable packages already installed, UNCHECK the 'Visual C++ Compilers' and 'Microsoft Visual C++ 2010' options. Otherwise, keep them checked.
5. Continue through the wizard to download and install the SDK. Depending on the speed of your Internet connection, this step will take several minutes to an hour or more.
6. The setup wizard finishes.
7. Apply the SDK 7.1 patch from Microsoft below:
*** Install Visual C++ 2010 Express ***
1. Go to:
Scroll down and find the block for Visual Studio 2010
You may need to create an account in order to get access to the download page. Please search "visual studio 2010 express"
Choose your download language, the system architecture and the installer type. Here is the example of installing Visual Studio 2010 Express with x86 architecture, English language, and EXE installer. Depending on your browser’s security settings, you may be prompted to proceed with the download of vc_web.exe.
2. When the download is complete, choose to run the file vc_web.exe. Depending on your security settings, you may be prompted by User Account Control (UAC) to confirm “mak[ing] changes to this computer”.
3. Click through the installation wizard, accepting the license agreement, and not modifying the installation folder (which defaults to 'C:\Program Files (x86)\Microsoft Visual Studio 10.0'). Note that the list of items to be installed depends on what is already installed on your computer; the exact list of items to install may differ from these screenshots.
4. Depending on the speed of your Internet connection, download will take several minutes to an hour or more.
5. Installation will begin once the download is complete.
6. Midway through installation, you will be prompted to reboot your computer. Do so.
7. Installation will resume at the reboot.
8. Installation will finish.
*** Troubleshooting ***
If you run into installation problems with the SDK, delete the folder %TEMP%\sdksetup and then retry the web setup. Other troubleshooting tips can be found at:
  5 Comments
Mehdi
Mehdi on 17 Oct 2014
Hi Reza - I have the same problem. Did you manage to resolve it?

Sign in to comment.

More Answers (7)

Luis
Luis on 5 Oct 2014
I need to use the function "loadlibrary" in MATLAB 7.10 (R2010a) .
I installed the SDK 7.1, the patch from Microsoft below onto the SDK 7.1 installation, the Microsoft Visual C++ 2010, the Upgrade Visual C++ 2010 Express to SP1 and even the patch .
But still not working...
mex -setup
Please choose your compiler for building external interface (MEX) files:
Would you like mex to locate installed compilers [y]/n? y
Select a compiler: [1] Microsoft Visual C++ 2010 Express in c:\Program Files (x86)\Microsoft Visual Studio 10.0
Compiler: 1
Please verify your choices:
Compiler: Microsoft Visual C++ 2010 Express
Location: c:\Program Files (x86)\Microsoft Visual Studio 10.0
************************************************************************* Warning: MEX-files generated using Microsoft Visual C++ 2010 require that Microsoft Visual Studio 2010 run-time libraries be available on the computer they are run on. If you plan to redistribute your MEX-files to other MATLAB users, be sure that they have the run-time libraries. *************************************************************************
Trying to update options file: C:\Users\i7\AppData\Roaming\MathWorks\MATLAB\R2010a\mexopts.bat From template: C:\PROGRA~1\MATLAB\R2010a\bin\win64\mexopts\msvc100freeopts.bat Done . . .
************************************************************************ Warning: The MATLAB C and Fortran API has changed to support MATLAB variables with more than 2^32-1 elements. In the near future you will be required to update your code to utilize the new API. You can find more information about this at: http://www.mathworks.com/support/solutions/en/data/1-5C27B9/?solution=1-5C27B9 Building with the -largeArrayDims option enables the new API. ************************************************************************
|>> loadlibrary('HS3.dll','tiepie.h')|
| *??? Error using ==> loadlibrary at 282 Microsoft Visual C++ 2005 or 2008 is required to use this feature.* |
>> mex.getCompilerConfigurations
mex.CompilerConfiguration
Package: mex
Properties:
Name: 'Microsoft Visual C++ 2010 Express'
Manufacturer: 'Microsoft'
Language: 'C++'
Version: '10.0'
Location: 'c:\Program Files (x86)\Microsoft Visual Studio 10.0'
Details: [1x1 mex.CompilerConfigurationDetails]

Camilo Moncada
Camilo Moncada on 28 Jan 2015
Hi there I have MatLab 2013.a
and i have done the steps in this guid but i get the following compiler
>> mex -setup
Welcome to mex -setup. This utility will help you set up
a default compiler. For a list of supported compilers, see
http://www.mathworks.com/support/compilers/R2013a/win32.html
Please choose your compiler for building MEX-files:
Would you like mex to locate installed compilers [y]/n? y
Select a compiler:
[1] Lcc-win32 C 2.4.1 in D:\Users\DOCUME~1\sys\lcc
[2] Microsoft Software Development Kit (SDK) 7.1 in C:\Program Files\Microsoft Visual Studio 10.0
y dont see any Visual C ++2010 .. or whatever.
Can you help me with this.. i would appreciate it

Camilo Moncada
Camilo Moncada on 28 Jan 2015
Hi there I have MatLab 2013.a
and i have done the steps in this guid but i get the following compiler
>> mex -setup
Welcome to mex -setup. This utility will help you set up
a default compiler. For a list of supported compilers, see
http://www.mathworks.com/support/compilers/R2013a/win32.html
Please choose your compiler for building MEX-files:
Would you like mex to locate installed compilers [y]/n? y
Select a compiler:
[1] Lcc-win32 C 2.4.1 in D:\Users\DOCUME~1\sys\lcc
[2] Microsoft Software Development Kit (SDK) 7.1 in C:\Program Files\Microsoft Visual Studio 10.0
y dont see any Visual C ++2010 .. juts the SDK compiler Can you help me with this.. i would appreciate it

Camilo Moncada
Camilo Moncada on 29 Jan 2015
Hi there I have MatLab 2013.a
and i have done the steps in this guid but i get the following compiler
>> mex -setup
Welcome to mex -setup. This utility will help you set up
a default compiler. For a list of supported compilers, see
http://www.mathworks.com/support/compilers/R2013a/win32.html
Please choose your compiler for building MEX-files:
Would you like mex to locate installed compilers [y]/n? y
Select a compiler:
[1] Lcc-win32 C 2.4.1 in D:\Users\DOCUME~1\sys\lcc
[2] Microsoft Software Development Kit (SDK) 7.1 in C:\Program Files\Microsoft Visual Studio 10.0
y dont see any Visual C ++2010 .. juts the SDK compiler Can you help me with this.. i would appreciate it

Camilo Moncada
Camilo Moncada on 29 Jan 2015
Hi there I have MatLab 2013.a
and i have done the steps in this guid but i get the following compiler
>> mex -setup
Welcome to mex -setup. This utility will help you set up
a default compiler. For a list of supported compilers, see
http://www.mathworks.com/support/compilers/R2013a/win32.html
Please choose your compiler for building MEX-files:
Would you like mex to locate installed compilers [y]/n? y
Select a compiler:
[1] Lcc-win32 C 2.4.1 in D:\Users\DOCUME~1\sys\lcc
[2] Microsoft Software Development Kit (SDK) 7.1 in C:\Program Files\Microsoft Visual Studio 10.0
y dont see any Visual C ++2010 .. juts the SDK compiler Can you help me with this.. i would appreciate it

Camilo Moncada
Camilo Moncada on 29 Jan 2015
Hi there I have MatLab 2013.a
and i have done the steps in this guid but i get the following compiler
>> mex -setup
Welcome to mex -setup. This utility will help you set up
a default compiler. For a list of supported compilers, see
http://www.mathworks.com/support/compilers/R2013a/win32.html
Please choose your compiler for building MEX-files:
Would you like mex to locate installed compilers [y]/n? y
Select a compiler:
[1] Lcc-win32 C 2.4.1 in D:\Users\DOCUME~1\sys\lcc
[2] Microsoft Software Development Kit (SDK) 7.1 in C:\Program Files\Microsoft Visual Studio 10.0
y dont see any Visual C ++2010 .. juts the SDK compiler Can you help me with this.. i would appreciate it
  1 Comment
Tech Support
Tech Support on 23 Feb 2017
Hi Camilo,
There exists a Windows SDK 7.1 bug that will cause errors during installation or compilation of Microsoft Visual C++ 2010 Express or Professional SP1. If Microsoft Visual C++ 2010 is not installed correctly it would not be detected by 'mex -setup' command. Refer the below link to install a patch provided by Microsoft to resolve this issue:
https://www.mathworks.com/matlabcentral/answers/96611-how-do-i-install-microsoft-visual-c-2010-and-microsoft-windows-sdk-7-1

Sign in to comment.


Jaritza Doma
Jaritza Doma on 3 Sep 2015
will this also work on windows 8? what if I use other version of SDK, will that work with MATLAB? Also, am I right that SDK should always be downloaded first before Visual? please answer me.
  1 Comment
Dave Behera
Dave Behera on 29 Dec 2015
Yes, this should work on Windows 8. MATLAB supports Windows SDK 7.1 as of now. Other supported compilers can be found at:
Yes, SDK should be installed first before Visual Studio.

Sign in to comment.

Categories

Find more on COM Component Integration in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by