Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

VS2010 compile errors. stdio.h(378): fatal error C1003: error count exceeds 100; stopping compilation

Ask Question

I uses the win7 x64 OS and VS2010. I encountered an error that looks like something gone wrong with the compiler or setting environments or something like that. It happened during my programming suddenly. At first, my program can be compiled successfully. Then, without any reason(or some reason I didn't realize) the program came out with a long list of errors mentioning "stdio.h"

Then I built a new project for test which is a win32 console application, I followed the default "new->project" procedure and the code is like this:

#include "stdafx.h"
int _tmain(int argc, _TCHAR* argv[])
    return 0;

This is the default code(named "test.cpp"). Then I compiled it, and the same list of errors came out. They are like follows:

c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(238): error C2061: 语法错误: 标识符“_Printf_format_String_”
c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(240): error C2061: 语法错误: 标识符“_Printf_format_String_”
c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(253): error C2061: 语法错误: 标识符“_Scanf_format_String_”
c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(254): error C2061: 语法错误: 标识符“_Scanf_format_String_”
c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(258): error C2061: 语法错误: 标识符“_Scanf_s_format_String_”
c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(260): error C2061: 语法错误: 标识符“_Scanf_s_format_String_”
c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(285): error C2065: “_Printf_format_String_”: 未声明的标识符
c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(285): error C2143: 语法错误 : 缺少“)”(在“const”的前面)
c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(285): warning C4229: 使用了记时错误: 忽略数据上的修饰符
c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(285): error C2491: “printf”: 不允许 dllimport 数据 的定义
c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(285): error C2059: 语法错误:“)”
c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(287): error C2065: “_Printf_format_String_”: 未声明的标识符
c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(287): error C2143: 语法错误 : 缺少“)”(在“const”的前面)
c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(287): warning C4229: 使用了记时错误: 忽略数据上的修饰符
c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(287): error C2491: “printf_s”: 不允许 dllimport 数据 的定义
c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(287): error C2059: 语法错误:“)”
c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(304): error C2065: “_Scanf_format_String_”: 未声明的标识符
c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(304): error C2143: 语法错误 : 缺少“)”(在“const”的前面)
c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(304): warning C4229: 使用了记时错误: 忽略数据上的修饰符
c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(304): error C2491: “scanf”: 不允许 dllimport 数据 的定义
c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(304): error C2059: 语法错误:“)”
c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(305): error C2065: “_Scanf_format_String_”: 未声明的标识符
c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(305): error C2143: 语法错误 : 缺少“)”(在“const”的前面)
c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(305): warning C4229: 使用了记时错误: 忽略数据上的修饰符
c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(305): error C2491: “_scanf_l”: 不允许 dllimport 数据 的定义
c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(305): error C2059: 语法错误:“)”
c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(309): error C2065: “_Scanf_s_format_String_”: 未声明的标识符
c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(309): error C2143: 语法错误 : 缺少“)”(在“const”的前面)
c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(309): warning C4229: 使用了记时错误: 忽略数据上的修饰符
c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(309): error C2491: “scanf_s”: 不允许 dllimport 数据 的定义
c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(309): error C2059: 语法错误:“)”
c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(311): error C2065: “_Scanf_s_format_String_”: 未声明的标识符
c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(311): error C2143: 语法错误 : 缺少“)”(在“const”的前面)
c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(311): warning C4229: 使用了记时错误: 忽略数据上的修饰符
c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(311): error C2491: “_scanf_s_l”: 不允许 dllimport 数据 的定义
c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(311): error C2059: 语法错误:“)”
c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(318): error C2061: 语法错误: 标识符“_Printf_format_String_”
c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(319): error C2065: “_Dest”: 未声明的标识符
c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(319): error C2275: “size_t”: 将此类型用作表达式非法
c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(378): fatal error C1003: error count exceeds 100; stopping compilation

I have tried to restart the VS2010 and restart the computer, but it didn't help. It's driving me crazy, can any body help? Thanks!

The "stdafx.h" is like this:

// stdafx.h : 标准系统包含文件的包含文件,
// 或是经常使用但不常更改的
// 特定于项目的包含文件
#pragma once
#include "targetver.h"
#include <stdio.h>
#include <tchar.h>
// TODO: 在此处引用程序需要的其他头文件
                // stdafx.h : 标准系统包含文件的包含文件, // 或是经常使用但不常更改的 // 特定于项目的包含文件 //  #pragma once  #include "targetver.h"  #include <stdio.h> #include <tchar.h>    // TODO: 在此处引用程序需要的其他头文件
– bomb2peng
                Mar 7, 2014 at 4:54
                And we're going to want to see targetver.h also since it gets included right before stdio.h, where the first error happens.
– Carey Gregory is on strike
                Mar 7, 2014 at 5:11
                What happens if exclude <stdio.h>? Didn't you accidentally touch it? What is the date of the file?
– Spock77
                Mar 7, 2014 at 5:57

What happens if exclude <stdio.h>? Maybe you accidentally edited this file. What is the date of the stdio.h?

You can try get etalon stdio.h and compare files (with WinMerge utility or similar). Meanwhile C++ programs can work without it, <iostream> will be enough.

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.