Error using mex (line 206), need help

64 ビュー (過去 30 日間)
MichaelK Kim
MichaelK Kim 2012 年 10 月 20 日
コメント済み: Walter Roberson 2020 年 8 月 27 日
I've tried to utilize someone's coding on matlab with mex file. but it doesnt work at all. how can i fix this problem?
First of all, i've tried to setup the compiler on matlab using "mex -setup" command.
and then finished the setup.
but if i run the code, error came up!
here is my command and error. it looks simple issue, but i dont have a time to figure out solution by myself ;(
>> 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/win32.html
Please choose your compiler for building MEX-files:
Would you like mex to locate installed compilers [y]/n? y
Select a compiler:
[1] Lcc-win32 C 2.4.1 in C:\PROGRA~1\MATLAB\R2012a\sys\lcc
[2] Microsoft Visual C++ 2005 SP1 in C:\Program Files\Microsoft Visual Studio 8
[0] None
Compiler: 2
Please verify your choices:
Compiler: Microsoft Visual C++ 2005 SP1
Location: C:\Program Files\Microsoft Visual Studio 8
Are these correct [y]/n? y
***************************************************************************
Warning: Support for Microsoft Visual C++ 2005 SP1 will be discontinued in a
future release, at which time new versions will be supported.
For a list of currently supported compilers see:
http://www.mathworks.com/support/compilers/R2012a/win32.html
***************************************************************************
Trying to update options file: C:\Users\ MichaelKim\AppData\Roaming\MathWorks\MATLAB\R2012a\mexopts.bat
From template: C:\PROGRA~1\MATLAB\R2012a\bin\win32\mexopts\msvc80opts.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/help/techdoc/matlab_external/bsflnue-1.html
Building with the -largeArrayDims option enables the new API.
**************************************************************************
>> mex mhaLoad.cpp
C:\PROGRA~1\MATLAB\R2012A\BIN\MEX.PL: Error: 'mhaLoad.cpp' not found.
*Error using mex (line 206)
Unable to complete successfully.*
is there are simple way to solve?
I'm working on Win 7 32bit, matlab R2012a.
Thanks :)
  2 件のコメント
Walter Roberson
Walter Roberson 2020 年 8 月 27 日
https://social.msdn.microsoft.com/Forums/vstudio/en-US/adabf801-8006-47bd-9495-972e04df5c78/use-of-value-as-a-variable-name-in-unmanaged-c-code?forum=vcgeneral

サインインしてコメントする。

採用された回答

Jan
Jan 2012 年 10 月 20 日
You get this error message:
Error: 'mhaLoad.cpp' not found
This means, that MEX cannot find this file. Is it in the current directory? If not, either use CD to adjust the current directory or use a full path name:
mex D:\MatlabFiles\mhaLoad.cpp
  5 件のコメント
Walter Roberson
Walter Roberson 2017 年 1 月 22 日
Wendell does that file exist? For example should you have used
D:\MatlabFiles\Build2D\meshinfocpp.cpp
Or perhaps
D:\MatlabFiles\Build2Dmeshinfo.cpp

サインインしてコメントする。

その他の回答 (3 件)

SAMEER ahamed
SAMEER ahamed 2013 年 10 月 28 日
編集済み: Walter Roberson 2015 年 5 月 25 日
Hi,
I am new for Matlab , please let me know how i cna used viola jones algorithm code in matlab . when i have matlab command window compile mext -setup , i am getting error like please let me know step by step process , how would like to compile ?
.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/R2013a/win64.html
Please choose your compiler for building MEX-files:
Would you like mex to locate installed compilers [y]/n? y
No supported SDK or compiler was found on this computer.
For a list of supported compilers, see
http://www.mathworks.com/support/compilers/R2013a/win64.html
Error using mex (line 206)
Unable to complete successfully.
  1 件のコメント
Walter Roberson
Walter Roberson 2015 年 5 月 25 日

サインインしてコメントする。


nyanphyo aung
nyanphyo aung 2015 年 5 月 25 日
what version of you use matlab... matlab 2007b and visual studio 2000 will be ok,and truetime 1.5
  1 件のコメント
Walter Roberson
Walter Roberson 2015 年 5 月 25 日
"Visual Studio 2000" seems to be Microsoft Visual C++ version 6.0. MATLAB R2007b supported that for Windows 32 but not for Windows 64, for which Visual C++ 2005 SP1 (version 8.0) was the earliest supported product in that line. Microsoft SDK 14.0 was supported for Windows 64 but not for Windows 32. The C++ 2005 SP1 was supported for both.

サインインしてコメントする。


Prasoon Garg
Prasoon Garg 2018 年 3 月 12 日
編集済み: Prasoon Garg 2018 年 3 月 12 日
Hi all,
*For macOS only*** All the problems related to mex are resolved after the installation of Xcode. After installing Xcode, run the command:
mex -setup
After this try to run the code.
  1 件のコメント
Alejandro Dominguez Guadarrama
Alejandro Dominguez Guadarrama 2020 年 8 月 27 日
I'm working with version R2016b and I have Xcode installed. The problem in this case is the version of Xcode. Documentation of Matlab states the R2016b needs Xcode 6.x, 7.x, but I have Xcode 11.x.
I try running "mex -setup" but it doesn't work, I get the message...
"Error using mex
No supported compiler or SDK was found. For options, visit
http://www.mathworks.com/support/compilers/R2016b/maci64.html. "
Any idea how to solve this issue?
Alex

サインインしてコメントする。

Community Treasure Hunt

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

Start Hunting!

Translated by