编译android 报错,ctime:66: error: ‘::clock_t’ has not been declared,诡异的问题如下图:
报一个gnu的C++标准库的ctime的错误
程序中根本木有调用<ctime>,那这个诡异的问题是怎么来的呢?
后来发现我有一个类Time.h和Time.cpp,对就是这货,且不管为什么GNU为什么不识别大小写,为什么和标准库的<time.h>起冲突,但这个诡异的问题足以告诉我们:
一定不要起类名和标准库一样的名字,否则暂时木有问题,早晚会自食苦果的~~
------------------------------------------------------------
国外的盆友也遇到类似的问题:给个copy
So I lost a bit of time to this compiler error coming from a MacBook and OSX 10.5:
/usr/include/c++/4.0.0/ctime:66: error: ‘::clock_t’ has not been declared
/usr/include/c++/4.0.0/ctime:68: error: ‘::tm’ has not been declared
/usr/include/c++/4.0.0/ctime:70: error: ‘::clock’ has not been declared
/usr/include/c++/4.0.0/ctime:71: error: ‘::difftime’ has not been declared
/usr/include/c++/4.0.0/ctime:72: error: ‘::mktime’ has not been declared
/usr/include/c++/4.0.0