Skip to content

Arduino Compile Issue #45

Description

@niradat

Hi,
Following is my code on Arduino IDE using ATMEGA2560 Board.
`#include <SPI.h>
#include "ugui.h"
#include "ugui_config.h"

#define DISPLAY_WIDTH 160
#define DISPLAY_HEIGHT 128

#define MAX_OBJECTS 10
#define BuffOUT 40

char bufferOut[BuffOUT];
void window_1_callback(UG_MESSAGE *msg);
UG_GUI gui1963;
UG_COLOR color[3];

void my_int_func(UG_S16 x,UG_S16 y,UG_COLOR z)
{
unsigned int sum=0;
sum=x+y+z;
}

void setup()
{
void (*foo)(UG_S16,UG_S16,UG_COLOR);
foo = &my_int_func;

UG_Init(&gui1963, foo(2,2,3), 160, 128); 

UG_COLOR color[3];        
UG_WINDOW window_1;
UG_BUTTON button_1;
UG_BUTTON button_2;
UG_BUTTON button_3;
UG_TEXTBOX textbox_1;
UG_OBJECT obj_buff_wnd_1[MAX_OBJECTS];

UG_Init(&gui1963, foo(2,2,3), 160, 128);    

}

void loop()
{
// put your main code here, to run repeatedly:

}`

I encounter following error when compiling. Kindly provide an insight of whats going wrong?

testugui:27:43: error: invalid use of void expression

 UG_Init(&gui1963, foo(2,2,3), 160, 128);
                                       ^

testugui:37:43: error: invalid use of void expression

 UG_Init(&gui1963, foo(2,2,3), 160, 128);

Regards,

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions