简体   繁体   中英

my code won't compile

i get an error "missing ; before identifier".

no ; is missing.

this error appears only when i include one of the files: MAPIDefS.h Windows.h wtypes.h WinBase.h

what could be the problem?

Thanks a whole lot. I tried everything everybody suggested and it worked. The problem was I used a name in my file which was also defined in these header files.

All of these include files, except for MAPIDefs.h , are already included by Windows.h .
Manually including them will cause obscure errors.

You should remove all of the includes except for Windows.h and MAPIDefs.h .

Check the file which includes that header file, or any previous includes. Sometimes the error may propagate from previous files.

The most common mistake which gives such strange errors is omitting the semicolon ; after a class definition in one of the headers.

That's all I can say without seeing any code, hope that helps.

include windows.h before other windows api files.

If you have other include files or #define statements before the windows api files then you probably have define a symbol that is used in the API files. You should check that.

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM