MATLAB Answers

0

Error using mex (line 206), need help

Asked by MichaelK Kim on 20 Oct 2012
Latest activity Edited by Prasoon Garg on 12 Mar 2018
Accepted Answer by Jan
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 :)

  0 Comments

Sign in to comment.

4 Answers

Jan
Answer by Jan
on 20 Oct 2012
 Accepted Answer

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 Comments

this problem is not solved by putting its path also, give any ideas for this...............
Wendell
on 22 Jan 2017
I have the same problem...i tried the full path name, but the error is still there.." C:\PROGRA~1\MATLAB\R2013A\BIN\MEX.PL: Error: 'D:\MatlabFiles\Build2Dmeshinfocpp.cpp' not found."
Wendell does that file exist? For example should you have used
D:\MatlabFiles\Build2D\meshinfocpp.cpp
Or perhaps
D:\MatlabFiles\Build2Dmeshinfo.cpp

Sign in to comment.


Answer by SAMEER ahamed on 28 Oct 2013
Edited by Walter Roberson
on 25 May 2015

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.

Answer by nyanphyo aung on 25 May 2015

what version of you use matlab... matlab 2007b and visual studio 2000 will be ok,and truetime 1.5

  1 Comment

"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.

Sign in to comment.


Answer by Prasoon Garg on 12 Mar 2018
Edited by Prasoon Garg on 12 Mar 2018

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.

  0 Comments

Sign in to comment.