I’m writing embedded software for the ti C5515 in ccstudio, using the CSL libraries. I’m having trouble with type definitions. In specific, I get this error:
#20 identifier "Bool" is undefined in csl_intc.h
Taking a look at the header, I find the bool definition in tistdtypes.h; within scope, as far as I can tell. In desperation, I add a typedef to the top of the file. However, then it complains that bool is already defined.
I’ve made sure that the case is the same, and that there isn’t another tistdtypes.h somewhere overriding the definition. How is it possible that it complains that there is no typedef, but when I add one, it says that there is one already?
Here are the two errors, one after the other:
#20 identifier "Bool" is undefined TMS320C5515 line 992, external location: ... csl_intc.h
#102 "Bool" has already been declared in the current scope TMS320C5515 line 914, external location: ... csl_intc.h
The file path is exactly the same. I can also paste the lines between 992 and 914 if necessary. There isn’t much.
When I use the file in question:
and run this program via
gcc -Werror -Wall, I’m not seeing any such errors. So unless your version is different from the one I linked to, I’d say there’s something wrong with how it’s being compiled into your program.Could you add some more details regarding how it’s included, if your version of
tistdtypes.his different than when I linked to, and how the target is being compiled?As a “worst case” backup at least you know that a
Boolis really aunsigned short, so you could always modify your code to just not use the typedef.EDIT:
I just took a look at csl_intc.h. It uses
Boolin that file without including the definition of it. What happens if you includetistdtypes.hin this file?