开发者

How to fix header file error?

So, my question is how to fix some error in header file, to run program normally? For example I use c++ builder 2010 and when winuser.h file is included, the program always get error like thi开发者_如何学Pythons

Checking project dependencies... Compiling Project7.cbproj (Debug configuration) [BCC32 Error] winuser.h(47): E2257 , expected Full parser context File6.cpp(4): #include c:\program files (x86)\embarcadero\rad studio\7.0\include\winuser.h [BCC32 Error] winuser.h(48): E2257 , expected Full parser context

i try to replace that file with original from default installation, but that still get same error, how to fix that?


The error is almost certainly caused by whatever code appears before line 4 of File6.cpp. Most likely that is another header file, in which case it is likely that the code therein is malformed - a missing semicolon or brace for example.

The quickest way to verify that winuser.h is not the issue is to change the order of inclusion so that winuser.h is included first.

Another possibility is that something in winuser.h is dependent on some other header not previously included or directly included in winuser.h. Most Win32 API headers are included by windows.h, and it is generally advisable to include windows,h rather than either of its children.


The message is hard to read but the actual error is "E2257 , expected" (coma expected)

From the RAD studio documentation:

A comma was expected in a list of declarations, initializations, or parameters.

This problem is often caused by a missing syntax element earlier in the file 
or one of its included headers.

The error message give you the line where it happened and you should probably look before that. There is probably some '}', ')' or ';' or other syntaxic closer missing in your code just before the error (likely before inclusion of the header file in your code). Full error message (you truncated it) or actual code would make it easier to spot.

It is also possible, even if unlikely, that the error is in one of the headers included in winuser.h.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜