Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.
|
|
|
|
Re: C2371: 'mxArray' : redefinition; different basic types
Posted:
Jan 3, 2013 7:15 PM
|
|
"Krzysztof Fajst" <fajst_k@hotmail.com> wrote in message <kc54sp$2r5$1@newscl01ah.mathworks.com>... > Hi, > > Im trying to MEX piece of code with VS 2010 MATLAB 2012b and getting this error > > c:\users\krzysztof\desktop\libocas_v096\libocas_v096\sparse_mat.h(27) : error C2371: 'mxArray' : redefinition; different basic types > c:\program files\matlab\r2012b\extern\include\matrix.h(293) : see declaration of 'mxArray' > > the code contains #include <mex.h> which includes matrix.h > > another piece code includes sparse_mat.h which redefines matrix.h types e.g. > > typedef struct { > INDEX_TYPE_T *ir; > INDEX_TYPE_T *jc; > INDEX_TYPE_T m; > INDEX_TYPE_T n; > double *pr; > NNZ_TYPE_T nzmax; > int sparse; > > } mxArray; > > Any idea how to get rid of this error ??
You can't have two different definitions for mxArray in your code, plain and simple. MATLAB already has mxArray defined, so you will need to pick another name for your custom struct type.
James Tursa
|
|
|
|