Reply by Richard Williams June 15, 20092009-06-15
William,

I have not seen the #pragma once; in the CCS 3.3 documentation.
Perhaps I just missed it. Though I have browsed the documentation on pragma
statements.

R. Williams

---------- Original Message -----------
From: William C Bonner
To: Richard Williams
Cc: c...@yahoo.com, c...
Sent: Mon, 15 Jun 2009 13:32:50 -0700
Subject: Re: [c6x] Re: Errors building Simulink Project for DSK 6713

> An alternative, that at least works with C++ is to use the simple "#pragma
> once" http://en.wikipedia.org/wiki/Pragma_once
>
> It may be a non-standard directive, but It seems to work in the Code
> Composer Studio tools (3.1.23) that I'm using, as well as the current
> version of MS Visual Studio.
>
> On Mon, Jun 15, 2009 at 7:26 AM, Richard Williams wrote:
>
> >
> >
> >
> > Asif,
> >
> > Each header file (must) have a wrapper that stops the file from being
> > loaded
> > more than once for any one compilation.
> >
> > From the error messages, I see that the tmwtypes.h header file does not
> > have
> > that wrapper.
> >
> > Notes:
> > 1) the name used is not critical, but; it must be unique.
> > 2) use '_' not '.' in the defined name
> > 3) standard practice is to capitalize the defined name
> > 4) standard practice is to use the header file name for the defined name
> > 5) good programing practice is to put a comment at the end of the header
> > file
> > after the #endif
> > 6) good programing practice is to put a comment on the #endif to indicate
> > which
> > '#if' it is associated to
> > 7) good programing practice is to put a descriptive header at the beginning
> > of
> > the header file, immediately before (or after) the '#define' statement
> >
> > The wrapper is written as follows:
> > ===========================================================> > /* ****************************** *\
> > * descriptive comments
> > \* ****************************** */
> > #ifndef TMWTYPES_H
> > #define TMWTYPES_H
> >
> > .. contents of header file here ..
> >
> > #endif /* TMWTYPES_H */
> > /* End of header file: tmwtypes.h */
> > ===========================================================> >
> > R. Williams
> >
> >
> > ---------- Original Message -----------
> > From: c...@yahoo.com
> > To: c...
> > Sent: Sun, 14 Jun 2009 01:13:59 -0400
> > Subject: [c6x] Re: Errors building Simulink Project for DSK 6713
> >
> > > Hi Everyone,
> > > >
> > > >I am asif doing comp engg from bahria university karachi pakistan,my
> > final
> > year project title is "Design and implementation of Real time CDMA based
> > wireless voice and data communication link using TI TMS320C6713"
> > > >
> > > >Rite now i am doing my final year project on dsp 6713,i am implementing
> > CDMA
> > communication system using 6713.
> > > >
> > > >To escape the extra work in writing c code, i am trying to build it
> > through
> > simulink model,but when i try to build the project for CCstudio Ver 3.1,i
> > get
> > about 150 errors....
> > > >First i was having problem with the error.."could not load source file
> > ****.h"...but somehow i was able to remove it,but after removing this error
> > i
> > started getting a no. of other errors that i am still unable to solve,i
> > would
> > highly appriciete if someone can solve my problem
> > > >
> > > >I have listed the some of the errors below........
> > > >
> > > >CCStudio......
> > > >-------------------------- mymodel.pjt - Custom_MW
> > --------------------------
> > > >[mymodel.cdb] "C:\CCStudio_v3.1\plugins\bios\gconfgen" mymodel.cdb
> > > >
> > > >[MW_c6xxx_bsl.c] "C:\CCStudio_v3.1\C6000\cgtools\bin\cl6x" -g
> > -fr"C:/MATLAB7/work/mymodel_c6000_rtw/Custom_MW" -d"_DEBUG"
> > -@"Custom_MW.lkf"
> > "MW_c6xxx_bsl.c"
> > > >
> > > >[MW_c6xxx_csl.c] "C:\CCStudio_v3.1\C6000\cgtools\bin\cl6x" -g
> > -fr"C:/MATLAB7/work/mymodel_c6000_rtw/Custom_MW" -d"_DEBUG"
> > -@"Custom_MW.lkf"
> > "MW_c6xxx_csl.c"
> > > >"C:\CCStudio_v3.1\C6000\cgtools\include\tmwtypes.h", line 9: warning:
> > typedef
> > name has already been declared (with same type)
> > > >"C:\CCStudio_v3.1\C6000\cgtools\include\tmwtypes.h", line 10: warning:
> > typedef name has already been declared (with same type)
> > > >"C:\CCStudio_v3.1\C6000\cgtools\include\tmwtypes.h", line 11: warning:
> > typedef name has already been declared (with same type)
> > > >"C:\CCStudio_v3.1\C6000\cgtools\include\tmwtypes.h", line 12: warning:
> > typedef name has already been declared (with same type)
> > > >"C:\CCStudio_v3.1\C6000\cgtools\include\tmwtypes.h", line 13: warning:
> > typedef name has already been declared (with same type)
> > > >"C:\CCStudio_v3.1\C6000\cgtools\include\tmwtypes.h", line 14: warning:
> > typedef name has already been declared (with same type)
> > > >"C:\CCStudio_v3.1\C6000\cgtools\include\tmwtypes.h", line 15: warning:
> > typedef name has already been declared (with same type)
> > > >"C:/CCStudio_v3.1/C6000/cgtools/include/simstruc_types.h", line 93:
> > error:
> > identifier "INT_MAX" is undefined
> > > >"C:/CCStudio_v3.1/C6000/cgtools/include/simstruc_types.h", line 137:
> > error:
> > identifier "int_T" is undefined
> > > >"C:\CCStudio_v3.1\C6000\cgtools\include\rtw_matlogging.h", line 17:
> > error:
> > identifier "int8_T" is undefined
> > > >"C:\CCStudio_v3.1\C6000\cgtools\include\rtw_matlogging.h", line 26:
> > error:
> > identifier "real_T" is undefined
> > > >"C:\CCStudio_v3.1\C6000\cgtools\include\rtw_matlogging.h", line 28:
> > error:
> > identifier "real_T" is undefined
> > > >"C:\CCStudio_v3.1\C6000\cgtools\include\rtw_matlogging.h", line 34:
> > error:
> > identifier "int_T" is undefined
> > > >"C:\CCStudio_v3.1\C6000\cgtools\include\rtw_matlogging.h", line 35:
> > error:
> > identifier "int_T" is undefined
> > > >"C:\CCStudio_v3.1\C6000\cgtools\include\rtw_matlogging.h", line 36:
> > error:
> > identifier "int_T" is undefined
> > > >"C:\CCStudio_v3.1\C6000\cgtools\include\rtw_matlogging.h", line 37:
> > error:
> > identifier "int_T" is undefined
> > > >"C:\CCStudio_v3.1\C6000\cgtools\include\rtw_matlogging.h", line 39:
> > error:
> > identifier "int_T" is undefined
> > > >"C:\CCStudio_v3.1\C6000\cgtools\include\rtw_matlogging.h", line 40:
> > error:
> > identifier "int_T" is undefined
> > > >These errors havent come due to a complex model....i only made a simple
> > input
> > output model using mic in ADC of 6713 .....and Line out DAC of 6713......
> > > >Regards,
> > > >Asif Gul Khan
> > > >
> > > >
> > >
> > > I would like to discuss, can you give me your email address
> > ------- End of Original Message -------
> >
> >
> >
------- End of Original Message -------

_____________________________________
Reply by William C Bonner June 15, 20092009-06-15
An alternative, that at least works with C++ is to use the simple "#pragma
once" http://en.wikipedia.org/wiki/Pragma_once

It may be a non-standard directive, but It seems to work in the Code
Composer Studio tools (3.1.23) that I'm using, as well as the current
version of MS Visual Studio.

On Mon, Jun 15, 2009 at 7:26 AM, Richard Williams wrote:

>
> Asif,
>
> Each header file (must) have a wrapper that stops the file from being
> loaded
> more than once for any one compilation.
>
> From the error messages, I see that the tmwtypes.h header file does not
> have
> that wrapper.
>
> Notes:
> 1) the name used is not critical, but; it must be unique.
> 2) use '_' not '.' in the defined name
> 3) standard practice is to capitalize the defined name
> 4) standard practice is to use the header file name for the defined name
> 5) good programing practice is to put a comment at the end of the header
> file
> after the #endif
> 6) good programing practice is to put a comment on the #endif to indicate
> which
> '#if' it is associated to
> 7) good programing practice is to put a descriptive header at the beginning
> of
> the header file, immediately before (or after) the '#define' statement
>
> The wrapper is written as follows:
> ===========================================================> /* ****************************** *\
> * descriptive comments
> \* ****************************** */
> #ifndef TMWTYPES_H
> #define TMWTYPES_H
>
> .. contents of header file here ..
>
> #endif /* TMWTYPES_H */
> /* End of header file: tmwtypes.h */
> ===========================================================>
> R. Williams
> ---------- Original Message -----------
> From: c...@yahoo.com
> To: c...
> Sent: Sun, 14 Jun 2009 01:13:59 -0400
> Subject: [c6x] Re: Errors building Simulink Project for DSK 6713
>
> > Hi Everyone,
> > >
> > >I am asif doing comp engg from bahria university karachi pakistan,my
> final
> year project title is "Design and implementation of Real time CDMA based
> wireless voice and data communication link using TI TMS320C6713"
> > >
> > >Rite now i am doing my final year project on dsp 6713,i am implementing
> CDMA
> communication system using 6713.
> > >
> > >To escape the extra work in writing c code, i am trying to build it
> through
> simulink model,but when i try to build the project for CCstudio Ver 3.1,i
> get
> about 150 errors....
> > >First i was having problem with the error.."could not load source file
> ****.h"...but somehow i was able to remove it,but after removing this error
> i
> started getting a no. of other errors that i am still unable to solve,i
> would
> highly appriciete if someone can solve my problem
> > >
> > >I have listed the some of the errors below........
> > >
> > >CCStudio......
> > >-------------------------- mymodel.pjt - Custom_MW
> --------------------------
> > >[mymodel.cdb] "C:\CCStudio_v3.1\plugins\bios\gconfgen" mymodel.cdb
> > >
> > >[MW_c6xxx_bsl.c] "C:\CCStudio_v3.1\C6000\cgtools\bin\cl6x" -g
> -fr"C:/MATLAB7/work/mymodel_c6000_rtw/Custom_MW" -d"_DEBUG"
> -@"Custom_MW.lkf"
> "MW_c6xxx_bsl.c"
> > >
> > >[MW_c6xxx_csl.c] "C:\CCStudio_v3.1\C6000\cgtools\bin\cl6x" -g
> -fr"C:/MATLAB7/work/mymodel_c6000_rtw/Custom_MW" -d"_DEBUG"
> -@"Custom_MW.lkf"
> "MW_c6xxx_csl.c"
> > >"C:\CCStudio_v3.1\C6000\cgtools\include\tmwtypes.h", line 9: warning:
> typedef
> name has already been declared (with same type)
> > >"C:\CCStudio_v3.1\C6000\cgtools\include\tmwtypes.h", line 10: warning:
> typedef name has already been declared (with same type)
> > >"C:\CCStudio_v3.1\C6000\cgtools\include\tmwtypes.h", line 11: warning:
> typedef name has already been declared (with same type)
> > >"C:\CCStudio_v3.1\C6000\cgtools\include\tmwtypes.h", line 12: warning:
> typedef name has already been declared (with same type)
> > >"C:\CCStudio_v3.1\C6000\cgtools\include\tmwtypes.h", line 13: warning:
> typedef name has already been declared (with same type)
> > >"C:\CCStudio_v3.1\C6000\cgtools\include\tmwtypes.h", line 14: warning:
> typedef name has already been declared (with same type)
> > >"C:\CCStudio_v3.1\C6000\cgtools\include\tmwtypes.h", line 15: warning:
> typedef name has already been declared (with same type)
> > >"C:/CCStudio_v3.1/C6000/cgtools/include/simstruc_types.h", line 93:
> error:
> identifier "INT_MAX" is undefined
> > >"C:/CCStudio_v3.1/C6000/cgtools/include/simstruc_types.h", line 137:
> error:
> identifier "int_T" is undefined
> > >"C:\CCStudio_v3.1\C6000\cgtools\include\rtw_matlogging.h", line 17:
> error:
> identifier "int8_T" is undefined
> > >"C:\CCStudio_v3.1\C6000\cgtools\include\rtw_matlogging.h", line 26:
> error:
> identifier "real_T" is undefined
> > >"C:\CCStudio_v3.1\C6000\cgtools\include\rtw_matlogging.h", line 28:
> error:
> identifier "real_T" is undefined
> > >"C:\CCStudio_v3.1\C6000\cgtools\include\rtw_matlogging.h", line 34:
> error:
> identifier "int_T" is undefined
> > >"C:\CCStudio_v3.1\C6000\cgtools\include\rtw_matlogging.h", line 35:
> error:
> identifier "int_T" is undefined
> > >"C:\CCStudio_v3.1\C6000\cgtools\include\rtw_matlogging.h", line 36:
> error:
> identifier "int_T" is undefined
> > >"C:\CCStudio_v3.1\C6000\cgtools\include\rtw_matlogging.h", line 37:
> error:
> identifier "int_T" is undefined
> > >"C:\CCStudio_v3.1\C6000\cgtools\include\rtw_matlogging.h", line 39:
> error:
> identifier "int_T" is undefined
> > >"C:\CCStudio_v3.1\C6000\cgtools\include\rtw_matlogging.h", line 40:
> error:
> identifier "int_T" is undefined
> > >These errors havent come due to a complex model....i only made a simple
> input
> output model using mic in ADC of 6713 .....and Line out DAC of 6713......
> > >Regards,
> > >Asif Gul Khan
> > >
> > >
> >
> > I would like to discuss, can you give me your email address
> ------- End of Original Message -------
>
>
>
Reply by Richard Williams June 15, 20092009-06-15
Asif,

Each header file (must) have a wrapper that stops the file from being loaded
more than once for any one compilation.

From the error messages, I see that the tmwtypes.h header file does not have
that wrapper.
Notes:
1) the name used is not critical, but; it must be unique.
2) use '_' not '.' in the defined name
3) standard practice is to capitalize the defined name
4) standard practice is to use the header file name for the defined name
5) good programing practice is to put a comment at the end of the header file
after the #endif
6) good programing practice is to put a comment on the #endif to indicate which
'#if' it is associated to
7) good programing practice is to put a descriptive header at the beginning of
the header file, immediately before (or after) the '#define' statement

The wrapper is written as follows:
===========================================================/* ****************************** *\
* descriptive comments
\* ****************************** */
#ifndef TMWTYPES_H
#define TMWTYPES_H

.. contents of header file here ..

#endif /* TMWTYPES_H */
/* End of header file: tmwtypes.h */
===========================================================R. Williams
---------- Original Message -----------
From: c...@yahoo.com
To: c...
Sent: Sun, 14 Jun 2009 01:13:59 -0400
Subject: [c6x] Re: Errors building Simulink Project for DSK 6713

> Hi Everyone,
> >
> >I am asif doing comp engg from bahria university karachi pakistan,my final
year project title is "Design and implementation of Real time CDMA based
wireless voice and data communication link using TI TMS320C6713"
> >
> >Rite now i am doing my final year project on dsp 6713,i am implementing CDMA
communication system using 6713.
> >
> >To escape the extra work in writing c code, i am trying to build it through
simulink model,but when i try to build the project for CCstudio Ver 3.1,i get
about 150 errors....
> >First i was having problem with the error.."could not load source file
****.h"...but somehow i was able to remove it,but after removing this error i
started getting a no. of other errors that i am still unable to solve,i would
highly appriciete if someone can solve my problem
> >
> >I have listed the some of the errors below........
> >
> >CCStudio......
> >-------------------------- mymodel.pjt - Custom_MW --------------------------
> >[mymodel.cdb] "C:\CCStudio_v3.1\plugins\bios\gconfgen" mymodel.cdb
> >
> >[MW_c6xxx_bsl.c] "C:\CCStudio_v3.1\C6000\cgtools\bin\cl6x" -g
-fr"C:/MATLAB7/work/mymodel_c6000_rtw/Custom_MW" -d"_DEBUG" -@"Custom_MW.lkf"
"MW_c6xxx_bsl.c"
> >
> >[MW_c6xxx_csl.c] "C:\CCStudio_v3.1\C6000\cgtools\bin\cl6x" -g
-fr"C:/MATLAB7/work/mymodel_c6000_rtw/Custom_MW" -d"_DEBUG" -@"Custom_MW.lkf"
"MW_c6xxx_csl.c"
> >"C:\CCStudio_v3.1\C6000\cgtools\include\tmwtypes.h", line 9: warning: typedef
name has already been declared (with same type)
> >"C:\CCStudio_v3.1\C6000\cgtools\include\tmwtypes.h", line 10: warning:
typedef name has already been declared (with same type)
> >"C:\CCStudio_v3.1\C6000\cgtools\include\tmwtypes.h", line 11: warning:
typedef name has already been declared (with same type)
> >"C:\CCStudio_v3.1\C6000\cgtools\include\tmwtypes.h", line 12: warning:
typedef name has already been declared (with same type)
> >"C:\CCStudio_v3.1\C6000\cgtools\include\tmwtypes.h", line 13: warning:
typedef name has already been declared (with same type)
> >"C:\CCStudio_v3.1\C6000\cgtools\include\tmwtypes.h", line 14: warning:
typedef name has already been declared (with same type)
> >"C:\CCStudio_v3.1\C6000\cgtools\include\tmwtypes.h", line 15: warning:
typedef name has already been declared (with same type)
> >"C:/CCStudio_v3.1/C6000/cgtools/include/simstruc_types.h", line 93: error:
identifier "INT_MAX" is undefined
> >"C:/CCStudio_v3.1/C6000/cgtools/include/simstruc_types.h", line 137: error:
identifier "int_T" is undefined
> >"C:\CCStudio_v3.1\C6000\cgtools\include\rtw_matlogging.h", line 17: error:
identifier "int8_T" is undefined
> >"C:\CCStudio_v3.1\C6000\cgtools\include\rtw_matlogging.h", line 26: error:
identifier "real_T" is undefined
> >"C:\CCStudio_v3.1\C6000\cgtools\include\rtw_matlogging.h", line 28: error:
identifier "real_T" is undefined
> >"C:\CCStudio_v3.1\C6000\cgtools\include\rtw_matlogging.h", line 34: error:
identifier "int_T" is undefined
> >"C:\CCStudio_v3.1\C6000\cgtools\include\rtw_matlogging.h", line 35: error:
identifier "int_T" is undefined
> >"C:\CCStudio_v3.1\C6000\cgtools\include\rtw_matlogging.h", line 36: error:
identifier "int_T" is undefined
> >"C:\CCStudio_v3.1\C6000\cgtools\include\rtw_matlogging.h", line 37: error:
identifier "int_T" is undefined
> >"C:\CCStudio_v3.1\C6000\cgtools\include\rtw_matlogging.h", line 39: error:
identifier "int_T" is undefined
> >"C:\CCStudio_v3.1\C6000\cgtools\include\rtw_matlogging.h", line 40: error:
identifier "int_T" is undefined
> >These errors havent come due to a complex model....i only made a simple input
output model using mic in ADC of 6713 .....and Line out DAC of 6713......
> >Regards,
> >Asif Gul Khan
> >
> > I would like to discuss, can you give me your email address
------- End of Original Message -------

_____________________________________
Reply by comm...@yahoo.com June 15, 20092009-06-15
Hi Everyone,
>
>I am asif doing comp engg from bahria university karachi pakistan,my final year project title is "Design and implementation of Real time CDMA based wireless voice and data communication link using TI TMS320C6713"
>
>Rite now i am doing my final year project on dsp 6713,i am implementing CDMA communication system using 6713.
>
>To escape the extra work in writing c code, i am trying to build it through simulink model,but when i try to build the project for CCstudio Ver 3.1,i get about 150 errors....
>First i was having problem with the error.."could not load source file ****.h"...but somehow i was able to remove it,but after removing this error i started getting a no. of other errors that i am still unable to solve,i would highly appriciete if someone can solve my problem
>
>I have listed the some of the errors below........
>
>CCStudio......
>-------------------------- mymodel.pjt - Custom_MW --------------------------
>[mymodel.cdb] "C:\CCStudio_v3.1\plugins\bios\gconfgen" mymodel.cdb
>
>[MW_c6xxx_bsl.c] "C:\CCStudio_v3.1\C6000\cgtools\bin\cl6x" -g -fr"C:/MATLAB7/work/mymodel_c6000_rtw/Custom_MW" -d"_DEBUG" -@"Custom_MW.lkf" "MW_c6xxx_bsl.c"
>
>[MW_c6xxx_csl.c] "C:\CCStudio_v3.1\C6000\cgtools\bin\cl6x" -g -fr"C:/MATLAB7/work/mymodel_c6000_rtw/Custom_MW" -d"_DEBUG" -@"Custom_MW.lkf" "MW_c6xxx_csl.c"
>"C:\CCStudio_v3.1\C6000\cgtools\include\tmwtypes.h", line 9: warning: typedef name has already been declared (with same type)
>"C:\CCStudio_v3.1\C6000\cgtools\include\tmwtypes.h", line 10: warning: typedef name has already been declared (with same type)
>"C:\CCStudio_v3.1\C6000\cgtools\include\tmwtypes.h", line 11: warning: typedef name has already been declared (with same type)
>"C:\CCStudio_v3.1\C6000\cgtools\include\tmwtypes.h", line 12: warning: typedef name has already been declared (with same type)
>"C:\CCStudio_v3.1\C6000\cgtools\include\tmwtypes.h", line 13: warning: typedef name has already been declared (with same type)
>"C:\CCStudio_v3.1\C6000\cgtools\include\tmwtypes.h", line 14: warning: typedef name has already been declared (with same type)
>"C:\CCStudio_v3.1\C6000\cgtools\include\tmwtypes.h", line 15: warning: typedef name has already been declared (with same type)
>"C:/CCStudio_v3.1/C6000/cgtools/include/simstruc_types.h", line 93: error: identifier "INT_MAX" is undefined
>"C:/CCStudio_v3.1/C6000/cgtools/include/simstruc_types.h", line 137: error: identifier "int_T" is undefined
>"C:\CCStudio_v3.1\C6000\cgtools\include\rtw_matlogging.h", line 17: error: identifier "int8_T" is undefined
>"C:\CCStudio_v3.1\C6000\cgtools\include\rtw_matlogging.h", line 26: error: identifier "real_T" is undefined
>"C:\CCStudio_v3.1\C6000\cgtools\include\rtw_matlogging.h", line 28: error: identifier "real_T" is undefined
>"C:\CCStudio_v3.1\C6000\cgtools\include\rtw_matlogging.h", line 34: error: identifier "int_T" is undefined
>"C:\CCStudio_v3.1\C6000\cgtools\include\rtw_matlogging.h", line 35: error: identifier "int_T" is undefined
>"C:\CCStudio_v3.1\C6000\cgtools\include\rtw_matlogging.h", line 36: error: identifier "int_T" is undefined
>"C:\CCStudio_v3.1\C6000\cgtools\include\rtw_matlogging.h", line 37: error: identifier "int_T" is undefined
>"C:\CCStudio_v3.1\C6000\cgtools\include\rtw_matlogging.h", line 39: error: identifier "int_T" is undefined
>"C:\CCStudio_v3.1\C6000\cgtools\include\rtw_matlogging.h", line 40: error: identifier "int_T" is undefined
>These errors havent come due to a complex model....i only made a simple input output model using mic in ADC of 6713 .....and Line out DAC of 6713......
>Regards,
>Asif Gul Khan

I would like to discuss, can you give me your email address

_____________________________________