I don't know why. I was able to compile a good project in Visual Studio 2005. Today I suddenly encountered the following problems:
Error 1 error midl2025: syntax error: expecting] or, near "annotation" C: \ Program Files \ microsoft sdks \ windows \ v6.0a \ include \ unknwn. IDL 108 Error 2 error midl2026: cannot recover from earlier syntax errors; aborting compilation c: \ Program Files \ microsoft sdks \ windows \ v6.0a \ include \ unwn. IDL 108
This is a problem related to the midl compiler. This problem occurs when you use the midl compiler of the old version for the new version of the Windows SDK header file.
The solution is to add your new version of midl compiler to the inclusion directory of Visual Studio. Midl error: 'annotation', blog of Microsoft Mike Wasson, has a detailed explanation. The content is summarized as follows:
A colleage recently got this error while compiling unknown. IDL: 1> C: \ Program Files \ microsoft sdks \ windows \ v6.0 \ include \ unknwn. IDL (108): Error midl2025: syntax error: expecting] or, near "annotation" 1> C: \ Program Files \ microsoft sdks \ windows \ v6.0 \ include \ unknwn. IDL (108): Error midl2026: cannot recover from earlier syntax errors; aborting compilation if you get this error, you are using a new version of the Windows headers with an older version of The midl compiler. fix: 1. make sure you installed the midl compiler when you installed the latest Windows SDK. it shoshould appear under "Program Files \ microsoft sdks \ windows \ v6.0 \ bin ". note: To install the midl compiler, You need to select Developer Tools/Windows development tools/Win32 development tools in the Windows SDK setup wizard. (at least, as of rc1.) 2. in Visual Studio, under tools> Options> projects and solutions> VC ++ directories> executable files, add X: \ Program Files \ microsoft sdks \ windows \ v6.0 \ bin to the top of the list.