9 years, 1 month ago.

problem when compiling with external gcc toolchain

Everything works great when I compile it in mbed. Great Job!

However - I exported the code as GCC Arm (Embedded) and tried to compile. Everything runs through pretty smooth until:

./TFT_fonts/Arial12x12.h:8:8: error: expected constructor, destructor, or type conversion before '(' token align(2) ^

./TFT_fonts/Arial24x23.h:10:8: error: expected constructor, destructor, or type conversion before '(' token align(2) ^

./TFT_fonts/Arial28x28.h:10:8: error: expected constructor, destructor, or type conversion before '(' token align(2) ^

./TFT_fonts/font_big.h:10:8: error: expected constructor, destructor, or type conversion before '(' token align(2) ^

Any Ideas ?

Thanks so much!!

Question relating to:

Lib for the new LCD Display with ILI9341 controller

3 Answers

7 years, 10 months ago.

Hi Did you ever solve this?

7 years, 10 months ago.

Hello,
Try to modify the font declaration in the header file as follows:

const unsigned char Arial12x12[] __attribute__ ((aligned (2))) = {

...

};


Zoltan

Thank you

posted by Eryk Sokolowski 19 Jun 2016

Hi Zoltan, Could you please tell me why you need to do it?

In some examples when I do this I get lots of warnings

in a file called pitch.h from the UniGraphics Demos

" ../pict.h:35:1: warning: narrowing conversion of 'XXX' from 'int' to 'char' inside { } is ill-formed in C++11 [-Wnarrowing] "

posted by Eryk Sokolowski 22 Jun 2016

Hello Eryk,
I would like to apologize for a mistake I made.The alignment shall be on two bytes, not on one as I originally suggested (now it's fixed). I'm not hundred per cent sure but I think it is to optimize the amount of used memory and the efficiency of retrieving the data from the memory.
See https://en.wikipedia.org/wiki/Data_structure_alignment for more details.
Zoltan

posted by Zoltan Hudak 23 Jun 2016
7 years, 10 months ago.

The SPI_TFT_IL9341 lib is deprecated. Please use the UniGraphic lib for new projects. https://developer.mbed.org/teams/GraphicsDisplay/code/UniGraphic/ This has fixed font declarations. You can also use them in your project.

Peter

Thank you

posted by Eryk Sokolowski 19 Jun 2016