Go Down

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

RenatoRod

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

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

dxw00d

#1
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={
to
Code: [Select]
const fontdatatype SmallFont[1144] PROGMEM={

RenatoRod

#2
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

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!

Arduino
via Egeo 16
Torino, 10131
Italy