-->
Page 1 of 2

System_get_time()

PostPosted: Thu Jan 05, 2017 7:51 am
by jmroman
Hi all!

I've been trying to use this function to retrieve a time stamp during execution buy the Arduino IDE keeps throwing the error:

Undefined reference to system_get_time()

It seems to me as if I should include a lib...but I don't kwow which. I have added some others like MCP3008 or MQTT and I can successfully read analog data and communicate by Mqtt.

Anyone out there can help ?

Thanks in advance!

Re: System_get_time()

PostPosted: Thu Jan 05, 2017 11:20 am
by Ribeiro Santos
Try, at top code, add

Code: Select allextern "C"{
  #include "user_interface.h"
}

Re: System_get_time()

PostPosted: Thu Jan 05, 2017 6:12 pm
by jmroman
Ribeiro Santos wrote:Try, at top code, add

Code: Select allextern "C"{
  #include "user_interface.h"
}


No luck! user_interface.h was already included. The undefined reference error is still there.

Re: System_get_time()

PostPosted: Fri Jan 06, 2017 8:37 am
by martinayotte
Are you sure you've included it using extern "C" ? (plain include in C++ won't work)