필터 지우기
필터 지우기

Mex files and C code

조회 수: 2 (최근 30일)
Juan Carlos
Juan Carlos 2014년 3월 4일
댓글: Shivaram Singh Rajput 2018년 1월 11일
Hello,
May someone help me? I am testing a C code previously generated with Matlab-Coder (the code inside has a lot of operations with matrixes), I must to test it using a MEX file but matlab is showing me an error, like this:
>> mex MEX_ANAVS.c
Building with 'Microsoft Visual C++ 2012 (C)'.
Error using mex
MEX_ANAVS.c
c:\program files\matlab\r2014a\extern\include\matrix.h(261) : error C2061: syntax error : identifier 'mxLogical'
c:\program files\matlab\r2014a\extern\include\matrix.h(261) : error C2059: syntax error : ';'
c:\program files\matlab\r2014a\extern\include\matrix.h(266) : error C2061: syntax error : identifier 'mxChar'
c:\program files\matlab\r2014a\extern\include\matrix.h(266) : error C2059: syntax error : ';'
c:\program files\matlab\r2014a\extern\include\matrix.h(427) : error C2061: syntax error : identifier 'mxIsNumeric'
c:\program files\matlab\r2014a\extern\include\matrix.h(427) : error C2059: syntax error : ';'
c:\program files\matlab\r2014a\extern\include\matrix.h(427) : error C2059: syntax error : 'type'
c:\program files\matlab\r2014a\extern\include\matrix.h(432) : error C2061: syntax error : identifier 'mxIsCell'
c:\program files\matlab\r2014a\extern\include\matrix.h(432) : error C2059: syntax error : ';'
c:\program files\matlab\r2014a\extern\include\matrix.h(432) : error C2059: syntax error : 'type'
c:\program files\matlab\r2014a\extern\include\matrix.h(437) : error C2061: syntax error : identifier 'mxIsLogical'
c:\program files\matlab\r2014a\extern\include\matrix.h(437) : error C2059: syntax error : ';'
c:\program files\matlab\r2014a\extern\include\matrix.h(437) : error C2059: syntax error : 'type'
c:\program files\matlab\r2014a\extern\include\matrix.h(442) : error C2061: syntax error : identifier 'mxIsChar'
Thank you so much in advance! :)
Juan
  댓글 수: 2
Skyler Shuford
Skyler Shuford 2016년 8월 17일
Did you ever get a solution for this? I'm having the same problem.
Shivaram Singh Rajput
Shivaram Singh Rajput 2018년 1월 11일
Hi Skyler, did you get a solution to this?

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

답변 (1개)

mirka
mirka 2016년 10월 24일
편집: mirka 2016년 10월 24일
Hello! I give a answer for other people although you already solved this prob. I got a same problem when compiling the c code (like "file_name.c" ) with 'Microsoft Visual C++ 2012 (C)'. The problem is the compiler. just change the c code file name to cpp file.(file_name.c -> file_name.cpp) then it may works. :)
I hope it helps yo!

카테고리

Help CenterFile Exchange에서 C Shared Library Integration에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by