Mex files and C code

2 visualizaciones (últimos 30 días)
Juan Carlos
Juan Carlos el 4 de Mzo. de 2014
Comentada: Shivaram Singh Rajput el 11 de En. de 2018
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 comentarios
Skyler Shuford
Skyler Shuford el 17 de Ag. de 2016
Did you ever get a solution for this? I'm having the same problem.
Shivaram Singh Rajput
Shivaram Singh Rajput el 11 de En. de 2018
Hi Skyler, did you get a solution to this?

Iniciar sesión para comentar.

Respuestas (1)

mirka
mirka el 24 de Oct. de 2016
Editada: mirka el 24 de Oct. de 2016
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!

Categorías

Más información sobre C Shared Library Integration en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by