error: '_localtime_not_threadsafe_' was not declared in this scope
2011-02-24 17:46
567 查看
'_localtime_not_threadsafe_' was not declared in this scope
多线程安全问题,不能直接用localtime,而要用localtime_r函数
1080 time_t timer;
1081 time(&timer);
1082
1083 struct tm *t_tm;
1084 char tmpbuf[8];
1085 //t_tm = localtime_r(&timer,t_tm);
1086 localtime_r(&timer,t_tm);
1087 //strftime(tmpbuf,128,"%F %X", newtime);
1088 sprintf(tmpbuf,"%4d%02d%02d", t_tm->tm_year, t_tm->tm_mon, t_tm->tm_mday);
多线程安全问题,不能直接用localtime,而要用localtime_r函数
1080 time_t timer;
1081 time(&timer);
1082
1083 struct tm *t_tm;
1084 char tmpbuf[8];
1085 //t_tm = localtime_r(&timer,t_tm);
1086 localtime_r(&timer,t_tm);
1087 //strftime(tmpbuf,128,"%F %X", newtime);
1088 sprintf(tmpbuf,"%4d%02d%02d", t_tm->tm_year, t_tm->tm_mon, t_tm->tm_mday);
相关文章推荐
- common.h:178:47: error: 'UINT64_C' was not declared in this scope
- error: 'glGenFramebuffersOES' was not declared in this scope
- error: 'memcpy' was not declared in this scope的解决
- error: 'EOF' was not declared in this scope的解决办法
- [Error] 'atoi' was not declared in this scope
- error: `cout' was not declared in this scope
- 【error: '_1' was not declared in this scope】
- c++ error: 'malloc' was not declared in this scope
- ndk编译错误:error: 'nullptr' was not declared in this scope
- qt-everywhere-opensource-src-4.8.1 出错:error: 'IPV6_MULTICAST_HOPS' was not declared in this scope
- 【Cocos2d-x】编译Android工程时提示error: 'GL_LINE_SMOOTH' was not declared in this scope
- 昨天的错误修改后,make出现error: 'UINT64_C' was not declared in this scope
- linux 编译ffmpeg 出错:error: 'UINT64_C' was not declared in this scope
- error: 'ff_get_buffer' was not declared in this scope
- [安卓]error: 'memcpy' was not declared in this scope
- error: 'EOF' was not declared in this scope的解决办法
- error: 'memcpy' was not declared in this scope
- error: 'UINT64_C' was not declared in this scope
- ffmpeg: 'UINT64_C' was not declared in this scope
- v4l2驱动摄像头 出现错误UINT64_C' was not declared in this scope 解决