Windows SDK 6.0A: unknwn.idl compilation error

來源:互聯網
上載者:User

不知道為什麼,之前還能在 Visual Studio 2005 下編譯得好好的工程,今天突然就碰到下面的問題:

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\unknwn.idl    108    

這個是 MIDL 編譯器相關的問題,當你給新版本的 Windows SDK 標頭檔使用舊版本的 MIDL 編譯器時,就會有這個問題。

解決的辦法,就是把你新版本的 MIDL 編譯器添加到 Visual Studio 的包含目錄裡。微軟 Mike Wasson 的部落格 MIDL error: 'annotation' 對此有著詳細的解釋,內容摘要如下:

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 should 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.
相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.