Go Down

Topic: SOLVED - UTFT library error: variable 'SmallFont' must be const... (Read 10247 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_GHL - a VASTLY upgraded version of UTFT_CTE. Coming soon to a TFT near you! 8) Shipping April 1 2016!

Go Up