Thread Subject: Building in Real-Time Workshop

Subject: Building in Real-Time Workshop

From: Eric Hettler

Date: 23 Mar, 2009 13:17:01

Message: 1 of 4

I am trying to build a model in Real-Time workshop with an s-function in it. When I do, I get a large amount of errors saying that things have been declared multiple times. It has to do with the files rt_mxclassid.h, matrix.h and rt_matrx.h. They all seem to want to declare the same things over and over. A sample of the errors can be found below. Does anyone know what may cause this or how to get the model to build?


c:\program files\matlab\r2007b\rtw\c\src\rt_mxclassid.h(29) : error C2365: 'mxINT64_CLASS' : redefinition; previous definition was 'enumerator'
        c:\program files\matlab\r2007b\extern\include\matrix.h(362) : see declaration of 'mxINT64_CLASS'
c:\program files\matlab\r2007b\rtw\c\src\rt_mxclassid.h(30) : error C2365: 'mxUINT64_CLASS' : redefinition; previous definition was 'enumerator'
        c:\program files\matlab\r2007b\extern\include\matrix.h(363) : see declaration of 'mxUINT64_CLASS'
c:\program files\matlab\r2007b\rtw\c\src\rt_mxclassid.h(34) : error C2365: 'mxOBJECT_CLASS' : redefinition; previous definition was 'enumerator'
        c:\program files\matlab\r2007b\extern\include\matrix.h(367) : see declaration of 'mxOBJECT_CLASS'
c:\program files\matlab\r2007b\rtw\c\src\rt_mxclassid.h(34) : error C2371: 'mxClassID' : redefinition; different basic types
        c:\program files\matlab\r2007b\extern\include\matrix.h(367) : see declaration of 'mxClassID'
C:\PROGRA~1\MATLAB\R2007b\rtw\c\src\rt_matrx.h(45) : error C2371: 'mxArray' : redefinition; different basic types
        c:\program files\matlab\r2007b\extern\include\matrix.h(311) : see declaration of 'mxArray'
C:\PROGRA~1\MATLAB\R2007b\rtw\c\src\rt_matrx.h(48) : error C2371: 'mxChar' : redefinition; different basic types
        c:\program files\matlab\r2007b\extern\include\matrix.h(341) : see declaration of 'mxChar'
C:\PROGRA~1\MATLAB\R2007b\rtw\c\src\rt_matrx.h(53) : error C2365: 'mxREAL' : redefinition; previous definition was 'enumerator'
        c:\program files\matlab\r2007b\extern\include\matrix.h(375) : see declaration of 'mxREAL'
C:\PROGRA~1\MATLAB\R2007b\rtw\c\src\rt_matrx.h(55) : error C2365: 'mxCOMPLEX' : redefinition; previous definition was 'enumerator'
        c:\program files\matlab\r2007b\extern\include\matrix.h(377) : see declaration of 'mxCOMPLEX'

Subject: Building in Real-Time Workshop

From: Ralph Schleicher

Date: 23 Mar, 2009 19:15:36

Message: 2 of 4

"Eric Hettler" <erichettler@yahoo.com> writes:

> I am trying to build a model in Real-Time workshop with an s-function
> in it. When I do, I get a large amount of errors saying that things
> have been declared multiple times. It has to do with the files
> rt_mxclassid.h, matrix.h and rt_matrx.h. They all seem to want to
> declare the same things over and over. A sample of the errors can be
> found below. Does anyone know what may cause this or how to get the
> model to build?

Which headers do you include in your S-function? Recompile with
<simstruc.h> only. Otherwise, you have to provide more information,
that is source code and full compilation log.

--
Ralph Schleicher <http://ralph-schleicher.de>

Development * Consulting * Training
Mathematical Modeling and Simulation
Software Tools

Subject: Building in Real-Time Workshop

From: Eric Hettler

Date: 23 Mar, 2009 20:37:01

Message: 3 of 4

Ralph Schleicher <rs@mueller-schleicher.de> wrote in message <87k56gm4o7.fsf@echo.mueller-schleicher.i>...
> "Eric Hettler" <erichettler@yahoo.com> writes:
>
> > I am trying to build a model in Real-Time workshop with an s-function
> > in it. When I do, I get a large amount of errors saying that things
> > have been declared multiple times. It has to do with the files
> > rt_mxclassid.h, matrix.h and rt_matrx.h. They all seem to want to
> > declare the same things over and over. A sample of the errors can be
> > found below. Does anyone know what may cause this or how to get the
> > model to build?
>
> Which headers do you include in your S-function? Recompile with
> <simstruc.h> only. Otherwise, you have to provide more information,
> that is source code and full compilation log.
>
> --
> Ralph Schleicher <http://ralph-schleicher.de>
>
> Development * Consulting * Training
> Mathematical Modeling and Simulation
> Software Tools

I compiled only with simstruc.h and I still get the same errors. The s-function I am trying to compile is a piece of freeware called TrueTime meant to simulate a computer network in simulink. I have modified it to run in a fixed step rather than variable so that Real-Time Workshop can work with it. The code itself is far too large to post here. I can mex the code and place it in a s-function block in simulink. I can even run the code in simulink with no problems and it functions perfectly. When I try to build it in Real-Time workshop, however, I get those errors I posted previously. This only happens once Real-Time Workshop begins trying to make the executable. Those are pretty much all of the errors I get. Although there are many more than I posted, they are all the same with just the variable name changed. The two different files seem to be declaring them one after another
and causing an error. If you could offer any suggestion on what may be wrong or how to go about debugging my code that would be very, very appreciated.

Thank you,

-Eric

Subject: Building in Real-Time Workshop

From: Ralph Schleicher

Date: 25 Mar, 2009 20:08:27

Message: 4 of 4

"Eric Hettler" <erichettler@yahoo.com> writes:

> I compiled only with simstruc.h and I still get the same errors. The
> s-function I am trying to compile is a piece of freeware called
> TrueTime meant to simulate a computer network in simulink. I have
> modified it to run in a fixed step rather than variable so that
> Real-Time Workshop can work with it. The code itself is far too large
> to post here. I can mex the code and place it in a s-function block
> in simulink. I can even run the code in simulink with no problems and
> it functions perfectly. When I try to build it in Real-Time workshop,
> however, I get those errors I posted previously.

Hello Eric,

I had a glimpse on ttkernel.cpp and there are some constructs in it that
will never work with a standalone RTW executable without redesign of the
code base. For example, definition of Matlab workspace variables from
within the MEX file. Looks as if you can't get what you want easily.

--
Ralph Schleicher <http://ralph-schleicher.de>

Development * Consulting * Training
Mathematical Modeling and Simulation
Software Tools

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
realtime workshop Eric Hettler 23 Mar, 2009 09:20:03
sfunction Eric Hettler 23 Mar, 2009 09:20:03
rssFeed for this Thread

Contact us at files@mathworks.com