Why MATLAB(2010b 64bit) Cannot Find C Compiler?

7 views (last 30 days)
I am trying to link C compiler to my MATLAB but have been experiencing difficulties.
I have followed the instructions in below thread to install SKD 7.1 and MS Visual C++.
The MS VC++ can run C code.(Which indicates that C compiler exists on my desktop). But my MATLAB cannot find any compilers using mex -setup command.
Below is what I got after running mex -setup command --
>> 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:
[0] None
Compiler: 0
mex: No compiler selected. No action taken.
**************************************************************************
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.
**************************************************************************
>> 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++ 11.1 (with Microsoft Visual C++ 2008 SP1 linker)
[2] Intel Visual Fortran 11.1 (with Microsoft Visual C++ 2008 SP1 linker)
[3] Intel Visual Fortran 11.1 (with Microsoft Visual C++ 2008 Shell linker)
[4] Intel Visual Fortran 10.1 (with Microsoft Visual C++ 2005 SP1 linker)
[5] Microsoft Visual C++ 2005 SP1
[6] Microsoft Visual C++ 2008 Express
[7] Microsoft Visual C++ 2008 SP1
[8] Microsoft Visual C++ 2010
[9] Microsoft Visual C++ 2010 Express
[0] None
Compiler: 9
The default location for Microsoft Visual C++ 2010 Express compilers is C:\Program Files\Microsoft Visual Studio 10.0,
but that directory does not exist on this machine.
Use C:\Program Files\Microsoft Visual Studio 10.0 anyway [y]/n? n
Please enter the location of your compiler: [C:\Program Files\Microsoft Visual Studio 10.0] C:\Program Files (x86)\Microsoft Visual Studio 10.0
Please verify your choices:
Compiler: Microsoft Visual C++ 2010 Express
Location: C:\Program Files (x86)\Microsoft Visual Studio 10.0
Are these correct [y]/n? y
***************************************************************************
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: D:\Users\modlda\AppData\Roaming\MathWorks\MATLAB\R2010b\mexopts.bat
From template: C:\PROGRA~1\MATLAB\R2010b\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.
**************************************************************************_
Any help will be much appreciated. Thanks.

Answers (1)

Steven Lord
Steven Lord on 8 Jul 2015
You told "mex -setup" where to find your compiler. It said it was done, then gave you a warning about a future change you may need to make to your code (to give you time to prepare for that change.)
So what happened when you tried to build a MEX-file after finishing those steps? Did it work? Did it error? If it threw an error what was the full text of that error?
  2 Comments
Danqing Lu
Danqing Lu on 10 Jul 2015
Hi Steven, Thanks for the quick reply. I did some more research based on your reply, and it seems that I have to modify the directory of "VCPackages" folder in mexopts.bat file. Finally my matlab can compile C file. Thanks again.
hoho koko
hoho koko on 17 Jun 2016
what are the modifications @Danqing_Lu

Sign in to comment.

Categories

Find more on Troubleshooting in MATLAB Compiler SDK 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!