look over these. i had to synthesis some .h files (e.g. Arduino.h) because i built this on my laptop
get.cpp
#include "Arduino.h"
#include "get.h"
//define ntp client to get time
WiFiUDP ntpUDP;
//NTPClient timeClient(ntpUDP, "pool.ntp.org"); //if you don't need Offset
NTPClient timeClient(ntpUDP, "pool.ntp.org", utcOffsetInSeconds);
const long utcOffsetInSeconds = 7200; //EU-Rome
//------ TIMESTAMP ------
unsigned long getTime(){
timeClient.update();
unsigned long Now = timeClient.getEpochTime();
Serial.println(Now);
}//end getTime
get.h -- since get.h references NTPClient, i added NTPClient.h to it to avoid relying that it is defined in some other file using get.h and since HTPClient.h referenced a WiFiUDP, i assumed NTPClient.h inlcuded WiFiUDP.h
#ifndef _GET_h_
#define _GET_h_
#include "NTPClient.h"
//Set the utcOffsetInSeconds of your local zone
extern const long utcOffsetInSeconds;
extern NTPClient timeClient;
//------ TIMESTAMP ------
unsigned long getTime();
#endif
main.cpp (i needed to add main() to link completely)
#include "Arduino.h"
#include "get.h"
Serial_s Serial;
// -----------------------------------------------------------------------------
void setup() {
//SERIAL
Serial.begin(115200);
//TIMETSAMP
timeClient.begin(); //--> the error refers to this
}//Setup
void loop() {
}//Loop
// -----------------------------------------------------------------------------
int
main ()
{
setup ();
loop ();
}
i hope you see what was done. i just made it link. i believe knowing what is required in a .h is a bit of an art, but easily tested when building. minimize what is in a .h.