Cannot generate MEX function

조회 수: 8 (최근 30일)
Julius
Julius 2013년 6월 23일
I tried to use MATLAB Coder to generate a MEX function from a MATLAB function.
I used the simplest example to make sure the MATLAB function is correct:
function c = add(a,b)
%#codegen
c = a + b;
But when building, there was an error:
??? Build error: Compilation returned error status code 2. See the target build log for further details.
And last few lines of the error report looks like this:
12 Creating library add_mex.x and object add_mex.exp
13 'cmd' is not recognized as an internal or external command,
14 operable program or batch file.
15 gmake: *** [add_mex.mexw64] Error 1
My MATLAB version is R2011a, and I have Microsoft Visual Studio 2010 installed on my computer as well, so I ran
mex -setup
to designate the compiler to VS2010.
Can somebody please tell me how to troubleshoot this?

채택된 답변

Lokesh Ravindranathan
Lokesh Ravindranathan 2013년 6월 23일
I think the same issue has been discussed here: http://www.mathworks.com/matlabcentral/answers/2926
  댓글 수: 1
Julius
Julius 2013년 6월 23일
Exactly my problem. Thanks.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB Algorithm Acceleration에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by