The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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,326
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" <> wrote in message <kc54sp$2r5$>...
> 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 {
> 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]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.