So, when I use the function strptime
I get both a warning:
warning: implicit declaration of function 'strptime'
and an error after that:
undefined reference to 'strptime'
Yes, I've included time.h
. Here is a small sample code of me using it.
#include <time.h>
void my_function()
{
char buf* = "2016-02-05 12:45:10";
struct tm time*;
...
strptime(buf, "%F %T", &time);
...
}
I know time.h
is working because in the same .c
file, I'm using strftime
, time_t
, and 'struct tm
from time.h
without a problem. I know it's strptime
, because when I comment that line of code, it compiles without any problems.