大家好,我是vc++的初学者。我写了一个测试代码:
#include <iostream.h>
#include <windef.h>
int main()
{
BOOL a;
cout << a;
return 1;
}
编译后有以下错误:
Compiling...
testbool.cpp
c:\program files\microsoft visual studio\vc98\include\winnt.h(3143) : error C2146: syntax error : missing ';' before identifier 'ContextRecord'
c:\program files\microsoft visual studio\vc98\include\winnt.h(3143) : error C2501: 'PCONTEXT' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\winnt.h(3143) : error C2501: 'ContextRecord' : missing storage-class or type specifiers
Error executing cl.exe.testbool.obj - 3 error(s), 0 warning(s)
我看了windef.h,它的确定义了typedef int BOOL,但为什么还会报错,并且是winnt.h报错?麻烦哪个高手给我指导下,在下先谢谢大家了。
另外网上说vc++头文件的bug很多,真的是这样吗?如果它有错误在哪儿能找到相关的更正资料?