Possibly version issue with Adafruit GFX?

Status
Not open for further replies.

jim lee

Well-known member
Tried to roll in some fonts for my Adafruit screen I'm getting this : Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/Adafruit_GFX/Fonts/FreeSans12pt7b.h:1:7: error: 'uint8_t' does not name a type

Before i go poking in there I figured I've give you guys a chance to have a look.

I think I have pretty up to date installs of all this. Certainly less than a couple months old?

Thanks!

-jim lee
 
I think I got it. They have to have the files ordered in some perfect sequence or it'll not work. I stumbled on the correct sequence and now at least it runs. Although the fonts are bigger than I hoped.

-jim lee
 
Hard to say without providing any additional information. Like simple sketch that shows the issue. I am assuming MAC from your error message.
Like what libraries are used. Does the compiler give any other hints, like it used library X but did not use library Y...
What Version of Arduino and Teensyduino? Hint go to help menu and click on the about menu item, and it will tell you both versions...

But glad you got it working
 
Yeah, the error messages showed I was using all teensy stuff. Hence my post here. My thought was that it was some flavor of version-itus and maybe it was a well known thing. That and I've been writing code for the last 3..4 days at warp 10 so I didn't want to slow down to pull everything apart to make up a test case. I read some instruction on the Adafruit Font page about where to add the #include, that should'nt have made any difference.. And it worked. Go figure!

So I'm back writing code and making myself dizzy.

Thanks for looking at it. Or at least thinking about it. :)

-jim lee
 
Again it depends... If for example you have a .c or .cpp file that simply includes: FreeSans12pt7b.h
This file starts off like:
Code:
const uint8_t FreeSans12pt7bBitmaps[] PROGMEM = {
  0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xCF, 0x3C, 0xF3, 0x8A, 0x20, 0x06, 0x30,
  0x31, 0x03, 0x18, 0x18, 0xC7, 0xFF, 0xBF, 0xFC, 0x31, 0x03, 0x18, 0x18,
  0xC7, 0xFF, 0xBF, 0xFC, 0x31, 0x01, 0x18, 0x18, 0xC0, 0xC6, 0x06, 0x30,
  0x04, 0x03, 0xE1, 0xFF, 0x72, 0x6C, 0x47, 0x88, 0xF1, 0x07, 0x20, 0x7E,
  0x03, 0xF0, 0x17, 0x02, 0x3C, 0x47, 0x88, 0xF1, 0x1B, 0x26, 0x7F, 0xC3,
  0xE0, 0x10, 0x02, 0x00, 0x00, 0x06, 0x03, 0xC0, 0x40, 0x7E, 0x0C, 0x0E,
  0x70, 0x80, 0xC3, 0x18, 0x0C, 0x31, 0x00, 0xE7, 0x30, 0x07, 0xE6, 0x00,
  ...

So there is no other includes here that would bring in the definition of uint8_t thus the error.

This is defined I think in places like: #include <stdint.h>

Which in normal Arduino sketch files this is probably automatically included. Likewise if your .c/.cpp file include Arduino.h
It will probably define it.

And so if you first include Adafruit_GFX.h file in your sources it include Arduino.h so it gets defined...

Of course maybe Adafruit should change their font header files to explicitly include stdint.h which hopefully would have avoided this.

Hope that helps
Kurt
 
Status
Not open for further replies.
Back
Top