【error】C1003: error count exceeds 100; stopping compilation ...winnt.h

添加#include<windows.h>之后出现如下问题:

Error	110	error C1003: error count exceeds 100; stopping compilation	C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\winnt.h	13550
Error	1	error C2008: '$' : unexpected in macro definition	C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\driverspecs.h	142
Error	2	error C2008: '$' : unexpected in macro definition	C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\driverspecs.h	294
Error	4	error C2008: '$' : unexpected in macro definition	C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\driverspecs.h	308
Error	6	error C2008: '$' : unexpected in macro definition	C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\driverspecs.h	312
Error	8	error C2008: '$' : unexpected in macro definition	C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\driverspecs.h	316
Error	10	error C2008: '$' : unexpected in macro definition	C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\driverspecs.h	320
Error	12	error C2018: unknown character '0x24'	C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\winnt.h	1202
Error	21	error C2018: unknown character '0x24'	C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\winnt.h	12880
Error	79	error C2018: unknown character '0x24'	C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\winnt.h	13305
Error	43	error C2059: syntax error : ')'	C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\winnt.h	12958
Error	49	error C2059: syntax error : ')'	C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\winnt.h	12975
Error	78	error C2059: syntax error : ')'	C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\winnt.h	13281
Error	90	error C2059: syntax error : ')'	C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\winnt.h	13352
Error	35	error C2061: syntax error : identifier 'DWORD'	C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\winnt.h	12922
Error	38	error C2061: syntax error : identifier 'DWORD'	C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\winnt.h	12932
Error	74	error C2061: syntax error : identifier 'DWORD'	C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\winnt.h	13263
Error	84	error C2061: syntax error : identifier 'DWORD'	C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\winnt.h	13325
Error	86	error C2061: syntax error : identifier 'DWORD'	C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\winnt.h	13334
Error	91	error C2061: syntax error : identifier 'DWORD'	C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\winnt.h	13366

【error】C1003: error count exceeds 100; stopping compilation ...winnt.h_第1张图片


解决方法修改工程属性中C++语言一个地方即可:Configuration Propterties -> C/C++ -> Language -> Disable Language Extensions: 由 Yes(/Za) 改为 No.

【error】C1003: error count exceeds 100; stopping compilation ...winnt.h_第2张图片

这个贴子上也有人回答过:https://connect.microsoft.com/VisualStudio/feedback/details/537354/void-main-should-give-a-warning


(转载请注明作者和出处:http://blog.csdn.net/xiaowei_cqu 未经允许请勿用于商业用途)


你可能感兴趣的:(【error】C1003: error count exceeds 100; stopping compilation ...winnt.h)