How can I use Microsoft Visual C++ 2012 to create MEX files with MATLAB 7.90 (R2009b)

1 view (last 30 days)
*I am trying to run C++ code in Matlab. Here what I did :
-------------------------- Start matlab code --------------------------------------------
mex -setup
Please choose your compiler for building external interface (MEX) files:
Would you like mex to locate installed compilers [y]/n? n
Select a compiler:
[1] Intel C++ 9.1 (with Microsoft Visual C++ 2005 SP1 linker)
[2] Intel Visual Fortran 10.1 (with Microsoft Visual C++ 2005 SP1 linker)
[3] Microsoft Visual C++ 2005 SP1
[4] Microsoft Visual C++ 2008 Express
[5] Microsoft Visual C++ 2008 SP1
------------------------- End matlab code ------------------------------------------------
* but if I entered any number of those above a message appers saying the following :
------------------------ Start matlab code -------------------------------------------------
***************************************************************************
Error: Could not find the 64-bit compiler. This may indicate that the
"X64 Compilers and Tools" or the Microsoft Windows Software
Development Kit (SDK) is not installed. To build 64-bit MEX-files
Microsoft Visual C++ 2008 Express Edition requires that these two
packages are installed properly.
***************************************************************************
----------------------------End matlab code----------------------------------
* I have installed the Microsoft Windows SDK 7.1 but nothing changed still getting the same error * I do not have MS visula studio 2008 I have 2012 can I use it instead
Thank you
  1 Comment
Viju
Viju on 4 Apr 2014
The list of supported compilers for MATLAB R2009b can be found at: http://www.mathworks.com/support/compilers/R2009b/
As you can see Visual Studio 2012 is not listed in there, which means it will most likely not work.
To install Microsoft Windows SDK 7.1 fine with the .NET Framework, follow the instructions in: http://www.mathworks.com/matlabcentral/answers/101105-how-do-i-install-microsoft-windows-sdk-7-1
Hope this helps!

Sign in to comment.

Answers (3)

abdulraham
abdulraham on 4 Apr 2014
I did but it did not work , I installed the two files and restart my matlab. unfortunately it gave me the same error.
Is there any step after I run the two files (the compiler and the SDK 7.1 with .NET framwork)?

Ken Atwell
Ken Atwell on 5 Apr 2014
The 7.1 SDK was not yet available/supported as-of R2009b (that SDK was released in 2010). You will need to use one of the supported compilers listed at http://www.mathworks.com/support/compilers/R2009b/win64.html, something that was available back in 2009.
You might be able to still find Microsoft Visual C+++ 2008 Express if you Google around a bit -- Microsoft does not appear to make is obviously available any longer.

abdulraham
abdulraham on 5 Apr 2014
Thank you all ,
it is working now. what i did i removed the SDK and MV C++ 2008 and re-install them both.

Categories

Find more on Troubleshooting in MATLAB Compiler SDK in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!