You need #include stdint.h BEFORE you #include any other library interfaces that need it.
Example:
My LCD library uses uint8_t types. I wrote my library with an interface ( Display.h ) and an implementation ( Display.c )
In display.c, I have the following options.
#include <stdint.h> #include <string.h> #include <avr/io.h> #include <Display.h> #include <GlobalTime.h>
And it works.
However, if I reorder them like this:
#include <string.h> #include <avr/io.h> #include <Display.h> #include <GlobalTime.h> #include <stdint.h>
I get an error message. This is because Display.h needs things from stdint.h , but cannot access it, because this information is compiled AFTER Display.h is displayed.
So, move stdint.h over any library that needs it, and you should no longer get the error.
LanchPad Apr 26 '14 at 2:54 on 2014-04-26 14:54
source share