MATLAB Answers

How can I use Microsoft Visual C++ 2010 to create MEX files with MATLAB 7.10 (R2010a)?

51 views (last 30 days)
I would like to use Visual C++ 2010 to create MEX files for use in MATLAB.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 21 Dec 2018
Edited: MathWorks Support Team on 21 Dec 2018
The Microsoft Visual C++ 2010 compiler is not supported on the released version of MATLAB 7.10 (R2010a), but support can be added by installing a patch. To install the patch:
1. Download the patch attached to this Solution. The patch includes files needed to support these combinations of MATLAB and Visual C++ 2010:
• Visual C++ 2010 Professional and 64-bit MATLAB 7.10 (R2010a)
• Visual C++ 2010 Professional and 32-bit MATLAB 7.10 (R2010a)
• Visual C++ 2010 Express (Windows SDK 7.1 also required) and 64-bit MATLAB 7.10 (R2010a)
• Visual C++ 2010 Express and 32-bit MATLAB 7.10 (R2010a)
2. Launch MATLAB 7.10 (R2010a). If running on Windows Vista or Windows 7 run as administrator by right-clicking on the MATLAB shortcut and choosing "Run As Administrator". This permits modification of files in the MATLAB installation path.
3. Confirm that you are running MATLAB 7.10 (R2010a). You can check this using the About box available at Help->About MATLAB.
4. Unzip the contents of the patch into your MATLAB installation using the following command on the MATLAB command window:
unzip( path_to_zip_file, matlabroot);
This command will automatically unzipped the files in the correct folder and you do not have to worry about placing them in correct folder.
5. Set up MEX to use Visual C++ 2010 with the command:
mex –setup
Visual C++ 2010 should now be among the listed options.
Note that this patch will only work with MATLAB 7.10 (R2010a). Using this patch with any version of MATLAB is not supported.
Other MathWorks products such as Real-Time Workshop do not support Visual C++ 2010.

  8 Comments

Show 5 older comments
Aravind
Aravind on 2 Mar 2014
i downloaded the Zip file mentioned down the answer,proceeded accordingly but got struck at step 4 it says "Undefined function or variable 'path_to_zip_file'." after i entered the command:unzip( path_to_zip_file, matlabroot); reply soon and must or what does this "Unzip the contents of the patch into your MATLAB installation using the following command on the MATLAB command window" mean i run it as a administrator and got error when typed the command mentioned..
Kaustubha Govind
Kaustubha Govind on 25 Mar 2014
Bernado, Aravind: You need to replace path_to_zip_file with the actual path of the ZIP-file on your computer (which depends on where you downloaded it to).
BERNARDO Ojeda
BERNARDO Ojeda on 4 Apr 2014
Says that the folder is a directory a does nothing the output of the unzip writes like the post "matlabroot" or has other name

Sign in to comment.

More Answers (4)

Joao
Joao on 9 Jan 2015
I carefully followed the steps, however, after invoking mex -setup, MATLAB cannot find Visual C++ as an installed compiler. Only the option '[0] None' is available. What have I done wrong?

  1 Comment

Sign in to comment.


xuelin chen
xuelin chen on 16 Apr 2016
Edited: Walter Roberson on 22 Apr 2016
Is the zip file mentioned down the answer the patch? Then, how to do with the patch?

  1 Comment

Namita Vishnubhotla
Namita Vishnubhotla on 22 Apr 2016
Yes, the zip file is the patch. Please follow the steps mentioned in the answer, and replace "path_to_zip_file" with the actual path to the zip file.

Sign in to comment.


Astha Ameta
Astha Ameta on 5 Nov 2016
Hello After replacing path_to_zip_file with the location of zip file, I get following error:
??? Error using ==> mkdir Access is denied.
Error in ==> extractArchive>extractArchiveEntry at 77 mkdir(parentDir)
Error in ==> extractArchive at 52 files = extractArchiveEntry( ...
Error in ==> unzip at 98 files = extractArchive(outputDir, api, mfilename);
How to proceed, please suggest.

  0 Comments

Sign in to comment.


Mario Daniele Fiore
Mario Daniele Fiore on 15 Apr 2019
Hello,
I can't see the attachment. Where is the zip file?

  0 Comments

Sign in to comment.

Sign in to answer this question.

Products


Release

R2010a