Go Down

Topic: SOLVED - UTFT library error: variable 'SmallFont' must be const... (Read 6091 times) previous topic - next topic


Jul 21, 2012, 05:50 am Last Edit: Jul 22, 2012, 01:16 am by RenatoRod Reason: 1

I need some help to start using the Henning Karlsen's UTFT libraries.
As a newbe I read the libraries reference in the arduino main site and do like this:

- download the .zip file;
- extract content to my Arduino sketch folder / libraries;
- open the UTFT_Demo_320x240.pde;
- click on the verify icon to compile it.

But I'm having the error:
/home/renato/mySketchDir/libraries/UTFT/DefaultFonts.c:14:14: error: variable 'SmallFont' must be const in order to be put into read-only section by means of '__attribute__((progmem))'

Do you have any idea?

PS: the lib site is: http://henningkarlsen.com/electronics/library.php?id=51


Jul 21, 2012, 09:27 am Last Edit: Jul 21, 2012, 09:33 am by dxw00d Reason: 1
It compiled fine for me.

You could try editing /home/renato/mySketchDir/libraries/UTFT/DefaultFonts.c, and changing:

Code: [Select]
fontdatatype SmallFont[1144] PROGMEM={
Code: [Select]
const fontdatatype SmallFont[1144] PROGMEM={


Jul 21, 2012, 02:27 pm Last Edit: Jul 22, 2012, 01:17 am by RenatoRod Reason: 1
OK dxw00d. Its runs, thanks!

I changed like your tip and compile/run it successfully.
I forgot to say that I'm using Debian and gcc 4.7.1


Hello , I am new to forum, seeking help in same matter.
I did the same trick but still it's not working.

DefaultFont.c is changed by me but not working.

Any suggestion?


Make sure you are using the latest version of UTFT(V2.81). Those problems are all dealt with.



UTFT_SdRaw now included in library manager!! ;) High speed image drawing from SD card to UTFT displays for Mega & DUE
UTFT_CTE FontIC superduper version available for nominal cost!! NEW - Can now add extra fonts. PM for details ;)

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131