Pages: [1]   Go Down
Author Topic: SOLVED - UTFT library error: variable 'SmallFont' must be const...  (Read 1903 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: July 21, 2012, 06:16:00 pm by RenatoRod » Logged

Gosport, UK
Offline Offline
Faraday Member
**
Karma: 21
Posts: 3113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It compiled fine for me.

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

Code:
fontdatatype SmallFont[1144] PROGMEM={
to
Code:
const fontdatatype SmallFont[1144] PROGMEM={
« Last Edit: July 21, 2012, 02:33:10 am by dxw00d » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: July 21, 2012, 06:17:35 pm by RenatoRod » Logged

Pages: [1]   Go Up
Jump to: