I try to setup and compile ugui.c on the raspberry pi 3.
when I compile I always get errors like this:
//////compiling /////////////
gcc -Wall -pthread -o ugui ugui.c -lpigpio -lrt
//////ERROR //////////////
ugui.c: In function ‘_UG_PutChar’:
ugui.c:5343:65: warning: suggest parentheses around arithmetic in operand of ‘|’ [-Wparentheses]
color = (((fc & 0xFF) b + (bc & 0xFF) (256 – b)) >> 8) & 0xFF |//Blue component
^
ugui.c:5345:73: warning: suggest parentheses around arithmetic in operand of ‘|’ [-Wparentheses]
(((fc & 0xFF0000) b + (bc & 0xFF0000) (256 – b)) >> 8) & 0xFF0000; //Red component
^
ugui.c:5392:75: warning: suggest parentheses around arithmetic in operand of ‘|’ [-Wparentheses]
color = (((fc & 0xFF) b + (bc & 0xFF) (256 – b)) >> 8) & 0xFF |//Blue component
^
ugui.c:5394:83: warning: suggest parentheses around arithmetic in operand of ‘|’ [-Wparentheses]
(((fc & 0xFF0000) b + (bc & 0xFF0000) (256 – b)) >> 8) & 0xFF0000; //Red component
^
ugui.c: At top level:
ugui.c:8483:10: error: conflicting types for ‘gui’
UG_GUI gui;
^
ugui.c:79:16: note: previous declaration of ‘gui’ was here
static UG_GUI* gui;
//////////////////////////////////////////////////////////////
//programm-code
/////////////////////////////////////////////////////////////
My main and pset function in the ugui.c file (at the end):
void ST7775R_pset(UG_S16 x ,UG_S16 y,UG_COLOR c)
{
.....
....
}
UG_GUI gui;
int main(void)
{
.....
.....
initST7775R();
Hello
I am desperate about follow errors:
I try to setup and compile ugui.c on the raspberry pi 3. when I compile I always get errors like this: //////compiling ///////////// gcc -Wall -pthread -o ugui ugui.c -lpigpio -lrt //////ERROR ////////////// ugui.c: In function ‘_UG_PutChar’: ugui.c:5343:65: warning: suggest parentheses around arithmetic in operand of ‘|’ [-Wparentheses] color = (((fc & 0xFF) b + (bc & 0xFF) (256 – b)) >> 8) & 0xFF |//Blue component ^ ugui.c:5345:73: warning: suggest parentheses around arithmetic in operand of ‘|’ [-Wparentheses] (((fc & 0xFF0000) b + (bc & 0xFF0000) (256 – b)) >> 8) & 0xFF0000; //Red component ^ ugui.c:5392:75: warning: suggest parentheses around arithmetic in operand of ‘|’ [-Wparentheses] color = (((fc & 0xFF) b + (bc & 0xFF) (256 – b)) >> 8) & 0xFF |//Blue component ^ ugui.c:5394:83: warning: suggest parentheses around arithmetic in operand of ‘|’ [-Wparentheses] (((fc & 0xFF0000) b + (bc & 0xFF0000) (256 – b)) >> 8) & 0xFF0000; //Red component ^ ugui.c: At top level: ugui.c:8483:10: error: conflicting types for ‘gui’ UG_GUI gui; ^ ugui.c:79:16: note: previous declaration of ‘gui’ was here static UG_GUI* gui;
////////////////////////////////////////////////////////////// //programm-code ///////////////////////////////////////////////////////////// My main and pset function in the ugui.c file (at the end):
void ST7775R_pset(UG_S16 x ,UG_S16 y,UG_COLOR c) { ..... .... } UG_GUI gui; int main(void) { ..... ..... initST7775R();
UG_Init(&gui, ST7775R_pset, 176, 220); //UG_SelectGUI(&gui); UG_Update();
spiClose(h); gpioTerminate();
return 0; }
whats wrong???