一个编译错误

/usr/include/c++/4.2.1/ctime:66: error: '::clock_t' has not been declared
/usr/include/c++/4.2.1/ctime:68: error: '::tm' has not been declared
/usr/include/c++/4.2.1/ctime:70: error: '::clock' has not been declared
/usr/include/c++/4.2.1/ctime:71: error: '::difftime' has not been declared
/usr/include/c++/4.2.1/ctime:72: error: '::mktime' has not been declared
/usr/include/c++/4.2.1/ctime:73: error: '::time' has not been declared
/usr/include/c++/4.2.1/ctime:74: error: '::asctime' has not been declared
/usr/include/c++/4.2.1/ctime:75: error: '::ctime' has not been declared
/usr/include/c++/4.2.1/ctime:76: error: '::gmtime' has not been declared
/usr/include/c++/4.2.1/ctime:77: error: '::localtime' has not been declared
/usr/include/c++/4.2.1/ctime:78: error: '::strftime' has not been declared

今天一个同事问如上的编译错误怎么解决,有点懵逼,明明这是编译器自带的头文件内容定义的,怎么会没定义,即使 #include <ctime>也没用,查了一阵, 终于想起了,

自己以前也碰到过,因为当时不小心自己定义了一个头文件 time.h, 然后 include到cpp中,导致 引用的某些文件 去include编译器的time.h的时候引用了自己的这个time.h, 修正 自己time.h的文件名后问题解决了

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值