I build project with Visual Studio and compile by using GCC located in raspberry pi with help of VisualGDB
I have simple c file with structure:
struct labing
{
lv_obj_t* panel;
lv_obj_t* label;
const char* title;
int high;
int width;
};
void createTopPanel(lv_obj_t * screen, labing * lb)
{
...
}
Compiler generates error:
error: unknown type name ‘labing’; did you mean ‘long’?
Looks like compiler doesn't understand structure labing declaration. Why and how to fix it?
The compiler doesn't understand
labing, because there is nolabingtype, only astruct labingtype.Either use a
typedeflike this (which will do thetypedefand the declaration of thestruct):or change
to
What you did would compile with C++, but not with C.