Problem with passing a struct to a function

Hi,

I have read this Passing struct to function (again) - Syntax & Programs - Arduino Forum thread and did what it sad but I cant get it to work.

I get this error:
void send_monitoring_data(SensorData* data)

^
exit status 1
unknown type name 'SensorData'

What have I done wrong?

Top of my sketch there is

#include "globals.h"   

SensorData data;

My globals looks like this:

#ifndef globals_h
#define globals_h

typedef struct {
  float temperature;
  float humidity;
  float pressure;
  int light;
} SensorData  ;

#endif

Later on in my sketch there is this:

   Serial.print("data.light: ");
    Serial.println(data.light);   
    Serial.print("Value: ");
    Serial.println(value);   
   send_monitoring_data(&data);

The function is in another .c file and looks like this

void send_monitoring_data(SensorData* data)
{
     //Do stuff here

}

I get the same error when doing it this way:

#ifndef globals_h
#define globals_h

struct SensorData  {
  float temperature;
  float humidity;
  float pressure;
  int light;
} ;

#endif

The IDE creates function prototypes for you. When it can. Well, guess what. In this case, it can't.

So, pretend that you really were a C programmer, and CREATE THE FUNCTION PROTOTYPES YOURSELF.

Already done that. It's been in there from the start.

The code works on my raspberry and on my laptop but it won't compile using Arduino IDE

The code works on my raspberry and on my laptop but it won't compile using Arduino IDE

The code that you made changes to, but did not re-post?

Please post complete code. We now have to guess that you did not include globals.h in your C file; and we might be guessing wrong.

Really, how difficult can it be to either post complete code or to create a small example that demonstrates the problem?