Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: C2371: 'mxArray' : redefinition; different basic types
Replies: 2   Last Post: Jan 3, 2013 7:37 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
James Tursa

Posts: 2,069
Registered: 8/5/09
Re: C2371: 'mxArray' : redefinition; different basic types
Posted: Jan 3, 2013 7:15 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"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



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.