I get the following error with a Windows file when compiling winbase.h
.
Not sure why I get a syntax error and the compiler shows many more:
1> c:\program files\microsoft sdks\windows\v6.0a\include\winbase.h(238) :
error C2146: syntax error : missing ';' before identifier 'Internal'
Here a simple code to reproduce the problem:
#include <winbase.h>
int main()
{
return 0;
}
Are you including <winbase.h>
directly?
You shouldn't - it expects to have some things defined/declared before it's processed. Specifically in this case the identifier ULONG_PTR
which is declared as a typedef in intsafe.h
.
Include <windows.h>
.
You are probably missing a ;
immediate before the #include <windows.h>
line in your code. Alternatively, there is some identifier-like text preceding the include file line.
int ABC
#include <windows.h>
如果您的代码很好,并且#include "winbase.h"
之前没有缺少分号,那么它应该是winbase.h
(或包含它的文件之一)之前缺少的包含。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.