Mex files and C code

2 ビュー (過去 30 日間)
Juan Carlos
Juan Carlos 2014 年 3 月 4 日
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 Center および File ExchangeC Shared Library Integration についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by