c - strptime giving "implicit declaration" and "undefined reference" -


so, when use function strptime both warning:

warning: implicit declaration of function 'strptime' 

and error after that:

undefined reference 'strptime' 

yes, i've included time.h. here 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 working because in same .c file, i'm using strftime, time_t, , 'struct tm time.h without problem. know it's strptime, because when comment line of code, compiles without problems.

you missing tell on platform are, compiler version, arguments ...

in case, strptime not in standard c, comes posix. got compiler options wrong such doesn't provide posix extensions c. gcc use -std=gnu11 instead of -std=c11, example.


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -