Cannot include elapsedMillis

Hello,

I've created seperate header file to keep my code nice and split to certain parts but i struggle on my new header file

#ifndef RELAY_H
#define RELAY_H

#include "stdint.h"
#include <elapsedMillis.h>


typedef struct
{
  uint8_t state;
  elapsedMillis startTime;
  elapsedMillis workTime;
  
}relay_control_t;


#endif/*RELAY_H*/

But compiler keeps yelling "unkown type name 'elapsedMillis'". Anyone has idea why it doesn't work? I noticed i can only include elapsedMillis in main file where i got setup and loop, any other place i try to include it just doesn't work.

But compiler keeps yelling "unkown type name 'elapsedMillis'".

Please post the complete error message and program

There is literaly nothing to post, empy project with only:

#include "relay.h"

In the main .c file.

Error message : "error: unknown type name 'elapsedMillis'"

Error appears only if i include "relay.h" in main .c file

elapsedMillis

What is it in the code that makes a data type ?

Please post the source for "elapsedMillis.h". In such circumstances, the type definition should be in there (and it is very likely malformed somehow).

I've attached elappsedMillis.h.

The thing is i can only include and use elapsedMillis in main .c file, attepts to include and use them in other files end up with such error. So seems like some kind of error with including.

my main file is "arduino file" not a .c file, can't tell what's the difference here but it might matter

@edit Nevermind the problem was some other .c file instead of .cpp

elapsedMillis.h (4.2 KB)

i can only include and use elapsedMillis in main .c file, attepts to include and use them in other files end up with such error.

I created the following program

#include "elapsedMillis.h"

void setup() 
{
  Serial.begin(115200);
  while(!Serial);
  Serial.println();
}

void loop() 
{
}

In the IDE I added a tab named elapsedMillis.h and copied the text from the file of the same name that you attached

It compiles OK for me