mex -setup does not see a C++ compiler

조회 수: 9 (최근 30일)
Nicole West
Nicole West 2012년 7월 5일
Hello, I am having trouble getting mex -setup to recognize any of the C++ compilers I have installed (Microsoft Visual C++ Express, Intel Studio 2011).
>> 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
What do I need to do to remedy this issue? I am using Matlab R2009a, so I am not sure the "patches" I have read about will fix my problem. Perhaps it is something more basic? Any suggestions/advice you might provide would be greatly appreciated!

답변 (4개)

Ken Atwell
Ken Atwell 2012년 7월 5일
You are using R2009a, so consult its pages for compilers that were supported at the time of its release:
Visual C++ 2005 SP1 was the supported Microsoft tool chain for use with Intel C++/Fortran version 9.1 or 10.1. It sounds like the Intel and Microsoft you are trying to use all post-date the release of 2009a, sorry.

Albert Yam
Albert Yam 2012년 7월 5일
If you know the path to the compiler, you can say [no] to locate installed compilers and manually give the path.

Ryan G
Ryan G 2012년 7월 5일
It does not appear to be a supported compiler. See here.
Although it is fully possible you may be ok with that compiler in what you are doing in MATLAB, you may run into issues down the road.

Nicole West
Nicole West 2012년 7월 5일
Thanks for your response. I thought about that, but when I tried it, it seemed to insist I select from a menu (that includes none of the compilers I actually have installed). At each iteration I tried selecting none or even just selecting one of the provided defaults, but when asked for a path it rejected what I entered:
>> 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] Intel Visual Fortran 9.1 (with Microsoft Visual C++ 2005 SP1 linker) [4] Microsoft Visual C++ 2005 SP1 [5] Microsoft Visual C++ 2008 Express [6] Microsoft Visual C++ 2008 SP1
[0] None
Compiler: C:\Program Files (x86)\Intel\Composer XE 2010 SP1 Please select from 0-6 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/data/1-5C27B9.html?solution=1-5C27B9 Building with the -largeArrayDims option enables the new API. ************************************************************************
Selecting none cancels the action, selecting another menu option brings this message:
The default location for Microsoft Visual C++ 2008 SP1 compilers is C:\Program Files (x86)\Microsoft Visual Studio 9.0, but that directory does not exist on this machine.
I am getting the sense that I am not adequately telling it where to look, but I unsure how/where to fix the problem.
Thanks again!

카테고리

Help CenterFile Exchange에서 Write C Functions Callable from MATLAB (MEX Files)에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by