I am trying to import arduino library to Code composer studio IDE. I imported it successfully, but i am getting some errors relating to size_t is not a type. I am aware that it has been defined in stddef.h header file. But i am not sure what has to be done to remove this error. To be precise what are the different ways of defining it and what all the header files to be included? So if anyone can help it would be great.
Thanks
From the little information you provided, it is hard to tell what is the problem. However, I may give you some guesses:
size_t
is platform dependable type. It is the exactly the type that returns by sizeof
operator.
So when you are using Arduino, it may has another definition or it contract to the one defined by your compiler. I have googled this problem and I found this two solution:
Arduino.h
in the cpp you are working with not just the header.physfs.h
, add this #include <stdlib.h>
Anyway, do you really want to use size_t
directly? if you are looking for unsigned long
you can use it directly.. size_t is a bit ambiguous type. For example, on Windows
,Intel
, it will have different size for x86
and x64
which may cause some problems especially if you are doing some level operation on it.
EDIT: if you are using size_t for the right purpose of it which is size of an object, you should stay using it. My note was just if you are using size_t whenever an unsigned long is needed.