Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compile error in 'winbase.h'

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; } 
like image 368
jdl Avatar asked Sep 07 '11 21:09

jdl


2 Answers

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>.

like image 190
Michael Burr Avatar answered Oct 09 '22 01:10

Michael Burr


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> 
like image 30
Andy Finkenstadt Avatar answered Oct 09 '22 01:10

Andy Finkenstadt