#error : ERROR: Use of C runtime library internal header file. 这错误什么意思?
#include<time.h>
#include<..\crt\src\ctime.h> //我用的是 VS2005 ,其他编译器可能要还相对路径
#include<iostream>
using namespace std;
int main()
{
time_t biggest=0x7fffffffffffffffI64; //15 个 f
cout<<_MAX__TIME64_T<<endl;
return 0;
}
在 ctime.h 里有
#define _MAX__TIME64_T 0x793406fffi64 /* number of seconds from
00:00:00, 01/01/1970 UTC to
23:59:59. 12/31/3000 UTC */
但包含后编译出错:
#error : ERROR: Use of C runtime library internal header file.
MSDN 上是这么解释的:
The error messages include the argument token-string and are currently not subject to macro expansion. These directives are most useful for detecting programmer inconsistencies and violation of constraints during preprocessing. The following example demonstrates error processing during preprocessing:
#if !defined(__cplusplus)
#error C++ compiler required.
#endif
When #error directives are encountered, compilation terminates.