WebIDE & Struct?

Are structs not working in the WebIDE? I know that with the Arduino IDE, struct definitions have to go into a header, but I can’t do that with the WebIDE:

struct test{
  unsigned long id;
  char* label;

// This #include statement was automatically added by the Spark IDE.
#include "lib1.h"

int getEventData(test& e) {
	return  0;
void setup() {


void loop() {


Errors encountered:

the_user_app.cpp:3:18: error: ‘test’ was not declared in this scope
the_user_app.cpp:3:24: error: ‘e’ was not declared in this scope
the_user_app.cpp: In function ‘int getEventData(test&)’:
the_user_app.cpp:4:25: error: ‘int getEventData(test&)’ redeclared as different kind of symbol
the_user_app.cpp:3:5: error: previous declaration of ‘int getEventData’

Try using a typedef

typedef struct {
  unsigned long id;
  char* label;
} test_t;

int getEventData(test_t & e) {

or with what you had…

 int getEventData(struct test & e) {```
1 Like

Thanks @david_s5 One more: Any idea on how to adapt this:

union genieFrame{
uint8_t bytes[GENIE_FRAME_SIZE];
genieFrameReportObj reportObject;

Nothing I seem to try works.

Hi @ClintonKeith

Have you seen this thread on the same subject?

1 Like

@bko, apparently not but thanks for pointing it out!