Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Error using mex (line 206) ,when selecting a C++ compiler. Using Win7 64bit, Matlab 2012a, and visual studio 2012.

Asked by John on 24 Apr 2013
Latest activity Commented on by Geoff Hayes on 16 Dec 2014 at 17:24

Error using mex (line 206) ,when selecting a C++ compiler. Using Win7 64bit, Matlab 2012a, and visual studio 2012.

Environment:
Win7 64bit.
Matlab 2012a.
visual studio 2012.

I am now trying to select an compiler for compiling C code.

I have install Visual Studio 2012 prof. fully.

I think I should have installed VC++ compiler and Windows SDK.

Here is what happened:

>> 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/R2012a/win64.html 
Please choose your compiler for building MEX-files: 
Would you like mex to locate installed compilers [y]/n? n
Select a compiler: 
[1] Intel C++ 12.0 (with Microsoft Software Development Kit (SDK) linker) 
[2] Intel C++ 12.0 (with Microsoft Visual C++ 2008 SP1 linker) 
[3] Intel C++ 12.0 (with Microsoft Visual C++ 2010 linker) 
[4] Intel C++ 11.1 (with Microsoft Visual C++ 2008 SP1 linker) 
[5] Intel Visual Fortran 12 (with Microsoft Software Development Kit (SDK) linker) 
[6] Intel Visual Fortran 12.0 (with Microsoft Visual C++ 2008 SP1 linker) 
[7] Intel Visual Fortran 12.0 (with Microsoft Visual C++ 2008 Shell linker) 
[8] Intel Visual Fortran 12.0 (with Microsoft Visual C++ 2010 linker) 
[9] Intel Visual Fortran 11.1 (with Microsoft Visual C++ 2008 SP1 linker) 
[10] Intel Visual Fortran 11.1 (with Microsoft Visual C++ 2008 Shell linker) 
[11] Microsoft Software Development Kit (SDK) 7.1 
[12] Microsoft Visual C++ 2005 SP1 
[13] Microsoft Visual C++ 2008 SP1 
[14] Microsoft Visual C++ 2010 
[0] None 
Compiler: 14
Warning: The default location for Microsoft Visual C++ 2010 compiler is: 
         "C:\Program Files (x86)\Microsoft Visual Studio 10.0" 
         but either that directory does not exist or the configuration 
         is invalid. 
Use C:\Program Files (x86)\Microsoft Visual Studio 10.0 anyway [y]/n? y
Please verify your choices: 
Compiler: Microsoft Visual C++ 2010  
Location: C:\Program Files (x86)\Microsoft Visual Studio 10.0 
Are these correct [y]/n? y
***************************************************************************** 
  Error: Microsoft Visual C++ 2010 requires the Microsoft Windows Software  
         Development Kit (SDK), but the SDK cannot be found.  Examine your   
         Microsoft Visual C++ 2010 installation. 
***************************************************************************** 
Error using mex (line 206)
Unable to complete successfully.

I tried to installed Microsoft Windows SDK 7.1 and requires .NET Framework 4.0 however failed.

It seems that I have had them, so I can't reinstall them.

4 Comments

John on 24 Apr 2013

I think I know the reason now. I installed visual studio 2010. And the problem was solved.

I think Matlab2012a is compatible with VS2010 but not VS2012(at least automaticly). Microsoft might had changed the directory of the VS C++ in VS2012 somewhere matlab2012a and I don't know.

I hope matlab 2013 can maintain the situation.

muhammad on 16 Dec 2014 at 4:48

i am facing the same error as u are facing above, i have matlab 2012a and vs2010 c++ express.i dnt know why this error occur as matlab 2012a compatible with vs2010? can you help me . i need to solve it

Geoff Hayes on 16 Dec 2014 at 17:24

Muhammad - the express version is not the same as MS Visual C++ 2010. You need a compiler that is compatible with your version of MATLAB. See http://www.mathworks.com/support/compilers/R2012a/win64.html for a list of compatible compilers with 64 bit Windows.

John

Products

No products are associated with this question.

1 Answer

Answer by Harsheel on 24 Apr 2013

Hi John, You are correct in mentioning that VS2012 is unsupported with MATLAB R2012a. Note that VS2012 was not launced yet when MATLAB R2012a was released. The support has been added though in MATLAB R2013a as shown in the table below:

http://www.mathworks.com/support/compilers/R2013a/index.html

Harsheel

Contact us