`

C语言编译器报错

c 
阅读更多
C语言编译器报错及其解决


编译器: TDM-GCC 4.7.1 32-bit
执行 gcc.exe...
gcc.exe "C:\Users\Administrator\Desktop\test1\2045.c" -o "C:\Users\Administrator\Desktop\test1\2045.exe" -m32 -g3  -I"F:\software(软件安装包)\Dev-cpp\MinGW64\x86_64-w64-mingw32\include"  -L"F:\software(软件安装包)\Dev-cpp\MinGW64\x86_64-w64-mingw32\lib32" -static-libgcc -m32 -g3
In file included from f:\software(软件安装包)\dev-cpp\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.1/../../../../x86_64-w64-mingw32/include/stddef.h:7:0,
                 from f:\software(软件安装包)\dev-cpp\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.1/include/stddef.h:1,
                 from D:\SoftwareDeveloping\eclipse_cpp\MinGW\include/stdio.h:26,
                 from C:\Users\Administrator\Desktop\test1\2045.c:1:

f:\software(软件安装包)\dev-cpp\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.1/../../../../x86_64-w64-mingw32/include/crtdefs.h:26:1: error: unknown type name 'size_t'
In file included from f:\software(软件安装包)\dev-cpp\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.1/../../../../x86_64-w64-mingw32/include/stddef.h:7:0,
                 from f:\software(软件安装包)\dev-cpp\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.1/include/stddef.h:1,
                 from D:\SoftwareDeveloping\eclipse_cpp\MinGW\include/stdio.h:26,
                 from C:\Users\Administrator\Desktop\test1\2045.c:1:
f:\software(软件安装包)\dev-cpp\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.1/../../../../x86_64-w64-mingw32/include/crtdefs.h:183:5: error: unknown type name 'wchar_t'
In file included from f:\software(软件安装包)\dev-cpp\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.1/include/stddef.h:1:0,
                 from D:\SoftwareDeveloping\eclipse_cpp\MinGW\include/stdio.h:26,
                 from C:\Users\Administrator\Desktop\test1\2045.c:1:
f:\software(软件安装包)\dev-cpp\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.1/../../../../x86_64-w64-mingw32/include/stddef.h:20:19: error: expected ',' or ';' before '_set_errno'
f:\software(软件安装包)\dev-cpp\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.1/../../../../x86_64-w64-mingw32/include/stddef.h:21:19: error: expected ',' or ';' before '_get_errno'
f:\software(软件安装包)\dev-cpp\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.1/../../../../x86_64-w64-mingw32/include/stddef.h:26:36: error: expected ',' or ';' before '__threadhandle'
f:\software(软件安装包)\dev-cpp\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.1/../../../../x86_64-w64-mingw32/include/stddef.h:218:19: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'typedef'

In file included from C:\Users\Administrator\Desktop\test1\2045.c:1:0:
D:\SoftwareDeveloping\eclipse_cpp\MinGW\include/stdio.h:191:65: error: unknown type name 'size_t'
D:\SoftwareDeveloping\eclipse_cpp\MinGW\include/stdio.h:202:55: error: unknown type name 'size_t'
D:\SoftwareDeveloping\eclipse_cpp\MinGW\include/stdio.h:206:56: error: unknown type name 'size_t'
D:\SoftwareDeveloping\eclipse_cpp\MinGW\include/stdio.h:216:46: error: unknown type name 'size_t'
D:\SoftwareDeveloping\eclipse_cpp\MinGW\include/stdio.h:217:48: error: unknown type name 'size_t'
D:\SoftwareDeveloping\eclipse_cpp\MinGW\include/stdio.h:297:40: error: expected ',' or ';' before 'fread'
D:\SoftwareDeveloping\eclipse_cpp\MinGW\include/stdio.h:298:40: error: expected ',' or ';' before 'fwrite'
In file included from C:\Users\Administrator\Desktop\test1\2045.c:1:0:
D:\SoftwareDeveloping\eclipse_cpp\MinGW\include/stdio.h:446:59: error: expected declaration specifiers or '...' before 'size_t'
D:\SoftwareDeveloping\eclipse_cpp\MinGW\include/stdio.h:450:60: error: expected declaration specifiers or '...' before 'size_t'
D:\SoftwareDeveloping\eclipse_cpp\MinGW\include/stdio.h:480:52: error: expected declaration specifiers or '...' before 'size_t'
D:\SoftwareDeveloping\eclipse_cpp\MinGW\include/stdio.h:482:25: error: expected declaration specifiers or '...' before 'size_t'
In file included from C:\Users\Administrator\Desktop\test1\2045.c:2:0:
D:\SoftwareDeveloping\eclipse_cpp\MinGW\include/string.h:36:65: error: expected declaration specifiers or '...' before 'size_t'
D:\SoftwareDeveloping\eclipse_cpp\MinGW\include/string.h:37:72: error: expected declaration specifiers or '...' before 'size_t'
D:\SoftwareDeveloping\eclipse_cpp\MinGW\include/string.h:38:68: error: expected declaration specifiers or '...' before 'size_t'
D:\SoftwareDeveloping\eclipse_cpp\MinGW\include/string.h:39:68: error: expected declaration specifiers or '...' before 'size_t'
D:\SoftwareDeveloping\eclipse_cpp\MinGW\include/string.h:40:59: error: expected declaration specifiers or '...' before 'size_t'
D:\SoftwareDeveloping\eclipse_cpp\MinGW\include/string.h:46:40: error: expected ',' or ';' before 'strcspn'
D:\SoftwareDeveloping\eclipse_cpp\MinGW\include/string.h:49:40: error: expected ',' or ';' before 'strlen'

D:\SoftwareDeveloping\eclipse_cpp\MinGW\include/string.h:50:68: error: expected declaration specifiers or '...' before 'size_t'
D:\SoftwareDeveloping\eclipse_cpp\MinGW\include/string.h:51:72: error: expected declaration specifiers or '...' before 'size_t'
D:\SoftwareDeveloping\eclipse_cpp\MinGW\include/string.h:52:68: error: expected declaration specifiers or '...' before 'size_t'
D:\SoftwareDeveloping\eclipse_cpp\MinGW\include/string.h:55:40: error: expected ',' or ';' before 'strspn'
D:\SoftwareDeveloping\eclipse_cpp\MinGW\include/string.h:58:40: error: expected ',' or ';' before 'strxfrm'
D:\SoftwareDeveloping\eclipse_cpp\MinGW\include/string.h:65:74: error: expected declaration specifiers or '...' before 'size_t'
D:\SoftwareDeveloping\eclipse_cpp\MinGW\include/string.h:66:74: error: expected declaration specifiers or '...' before 'size_t'
D:\SoftwareDeveloping\eclipse_cpp\MinGW\include/string.h:72:74: error: expected declaration specifiers or '...' before 'size_t'
D:\SoftwareDeveloping\eclipse_cpp\MinGW\include/string.h:73:61: error: expected declaration specifiers or '...' before 'size_t'

D:\SoftwareDeveloping\eclipse_cpp\MinGW\include/string.h:77:65: error: expected declaration specifiers or '...' before 'size_t'
D:\SoftwareDeveloping\eclipse_cpp\MinGW\include/string.h:80:74: error: expected declaration specifiers or '...' before 'size_t'
D:\SoftwareDeveloping\eclipse_cpp\MinGW\include/string.h:81:75: error: expected declaration specifiers or '...' before 'size_t'
D:\SoftwareDeveloping\eclipse_cpp\MinGW\include/string.h:90:73: error: expected declaration specifiers or '...' before 'size_t'
D:\SoftwareDeveloping\eclipse_cpp\MinGW\include/string.h:91:72: error: expected declaration specifiers or '...' before 'size_t'
D:\SoftwareDeveloping\eclipse_cpp\MinGW\include/string.h:101:73: error: expected declaration specifiers or '...' before 'size_t'
D:\SoftwareDeveloping\eclipse_cpp\MinGW\include/string.h:102:84: error: expected declaration specifiers or '...' before 'size_t'
D:\SoftwareDeveloping\eclipse_cpp\MinGW\include/string.h:104:54: error: expected declaration specifiers or '...' before 'size_t'
D:\SoftwareDeveloping\eclipse_cpp\MinGW\include/string.h:106:60: error: expected declaration specifiers or '...' before 'size_t'
D:\SoftwareDeveloping\eclipse_cpp\MinGW\include/string.h:111:64: error: expected declaration specifiers or '...' before 'size_t'
D:\SoftwareDeveloping\eclipse_cpp\MinGW\include/string.h:127:40: error: expected ',' or ';' before 'wcscspn'
D:\SoftwareDeveloping\eclipse_cpp\MinGW\include/string.h:129:40: error: expected ',' or ';' before 'wcslen'
D:\SoftwareDeveloping\eclipse_cpp\MinGW\include/string.h:130:77: error: expected declaration specifiers or '...' before 'size_t'
D:\SoftwareDeveloping\eclipse_cpp\MinGW\include/string.h:131:77: error: expected declaration specifiers or '...' before 'size_t'
D:\SoftwareDeveloping\eclipse_cpp\MinGW\include/string.h:132:76: error: expected declaration specifiers or '...' before 'size_t'

D:\SoftwareDeveloping\eclipse_cpp\MinGW\include/string.h:135:40: error: expected ',' or ';' before 'wcsspn'
D:\SoftwareDeveloping\eclipse_cpp\MinGW\include/string.h:138:40: error: expected ',' or ';' before 'wcsxfrm'
D:\SoftwareDeveloping\eclipse_cpp\MinGW\include/string.h:152:80: error: expected declaration specifiers or '...' before 'size_t'
D:\SoftwareDeveloping\eclipse_cpp\MinGW\include/string.h:153:71: error: expected declaration specifiers or '...' before 'size_t'
D:\SoftwareDeveloping\eclipse_cpp\MinGW\include/string.h:159:80: error: expected declaration specifiers or '...' before 'size_t'
D:\SoftwareDeveloping\eclipse_cpp\MinGW\include/string.h:160:82: error: expected declaration specifiers or '...' before 'size_t'
D:\SoftwareDeveloping\eclipse_cpp\MinGW\include/string.h:177:79: error: expected declaration specifiers or '...' before 'size_t'
D:\SoftwareDeveloping\eclipse_cpp\MinGW\include/string.h:178:70: error: expected declaration specifiers or '...' before 'size_t'
C:\Users\Administrator\Desktop\test1\2045.c: In function 'mian':
C:\Users\Administrator\Desktop\test1\2045.c:7:3: warning: incompatible implicit declaration of built-in function 'memset' [enabled by default]

执行结束





悲剧啊 main竟然写成了mian 。但是编译却不会直接报错,报了一些莫名其妙的东西出来。
IDE的好处增加开发效率
不好之处增强了开发人员对其依赖。


说明本文为原创,转载请注明出处。
Authorskywolf


0
5
分享到:
评论

相关推荐

    C语言编译器,能对基本的文法进行判断.

    C语言编译器是将程序员编写的源代码转换为目标代码(机器语言)的软件工具,它是C编程语言不可或缺的一部分。C语言编译器的主要任务是将高级语言(如C语言)的源代码转换成计算机可以理解和执行的机器指令。这个过程...

    c语言编译器

    C语言编译器的使用技巧包括合理设置编译选项(如-Wall用于开启所有警告,-O2用于开启优化等),理解编译器报错信息以快速定位问题,以及掌握编译和链接过程中的常见问题和解决方法。 在实际开发中,开发者通常会...

    C语言编译器源程序

    C语言编译器源程序是计算机科学领域中的一个重要主题,涉及到软件工程、编译原理以及计算机系统理解等多个方面的知识。C语言是一种强大的、高效的编程语言,广泛用于操作系统、嵌入式系统、应用程序开发等。而编译器...

    C语言编译器常见错误编码大全

    超过两个字符将导致编译器报错。 **示例**: ```c char c = 'a'; // 正确 char c = 'ab'; // 错误,字符常数包含多个字符 ``` #### 编译器错误C2017:非法的转义序列 **错误消息**:转义序列(如`\t`)出现在字符...

    c语言编译报错大全(中英文对照)

    ### c语言编译报错大全(中英文对照) 在C语言编程过程中,遇到各种各样的编译错误是在所难免的。这些错误可能是由于语法错误、类型不匹配、逻辑错误等原因导致的。为了帮助开发者更好地理解和解决这些问题,下面将...

    Compiler:小型C语言编译器

    基于java的C语言编译器 采用LL(1)文法进行分析,文法是C语言文法的子集,支持报错,以及错误原因 以前只用编译器编译程序,现在学完编译原理这门课以后,通过编译大作业,我对编译器的工作原理有了比较清晰的认识 ...

    基于C++实现类C语言编译器【100012455】

    本次课设,我们组采用LR(1)分析法,经过完整的五大编译步骤,将类C语言翻译为 8086汇编语言,并在DOS环境下运行,并调用debug-t-g-d查看程序运行后内存值,验证编译过程是否正确。 文法支持整数类型及判断语句中...

    c语言及c#报错翻译

    ### c语言及c#报错翻译 在编程过程中,遇到各种各样的错误是常有的事情。对于初学者来说,理解这些错误信息并找到相应的解决办法是非常重要的。下面将对给出的一些常见错误信息进行详细的解释与翻译,帮助大家更好...

    C语言报错中文翻译.txt

    ### C语言报错中文翻译知识点 #### 一、编译器错误信息理解与解决方法 在C语言编程过程中,遇到各种编译错误是不可避免的。理解这些错误信息并找到相应的解决办法是每个程序员必备的技能之一。下面我们将针对提供...

    C语言错误形式讲解(适用于英文基础较弱者)

    ### C语言错误形式讲解 在学习与应用C语言的过程中,开发者常常会遇到各种各样的编译错误或警告信息。对于英语基础较弱的学习者来说,理解这些错误信息可能会成为一大障碍。本文旨在通过列举常见的C语言错误名称...

    compiler:一个小型的c语言编译器

    compiler一个小型的c语言编译器目前实现的功能可以定义多个变量,并且能初始化。可以支持基本的加减乘除运算。可以支持带括号的多个变量的四则混合运算。可以支持单行注释和多行注释。可以输出%c格式的字符和%d格式...

    C语言常见错误提示信息

    - **缺少分号**:C语言中的语句结尾需要分号,如果遗漏,编译器会报错。 - **括号不匹配**:左右括号需要正确配对,否则会导致语法错误。 - **非法字符**:C语言只允许特定的字符集作为标识符,例如数字开头的...

    C语言报错整理大全[借鉴].pdf

    10. **行太长(Line too long)**:C语言对单行代码的长度有限制,如果超过这个限制,编译器会报错。 11. **未定义的类型标识符(Type identifier expected)**:使用了一个未声明的类型名称,如自定义的数据结构或...

    C语言词法分析和语法分析源码

    这是我毕设的一部分,毕设做的是C语言编译器,这部分是编译器的词法分析和语法分析。开发平台Visual Stuido 2010。语法分析仅仅是分析语法对不对,如果对会输出“OK”,反之输出“ERROR”词法分析完会把单词和类型列...

    Keil C51编译器用户手册 Keil C51编译器用户手册

    Keil C51是一款专为8051微控制器系列设计的C语言编译器,由Keil Software公司开发。这款编译器以其高效、易用和强大的功能在嵌入式系统开发领域广受欢迎。本手册是Keil C51编译器的详细指南,旨在帮助用户更好地理解...

    c语言常见错误提示

    如果编译器遇到一个不明确的符号,它将无法确定该符号的含义。 3. Argument list syntax error:参数表语法错误 函数的参数列表是非常重要的。如果参数列表的语法错误,将导致函数调用失败。 4. Array bounds ...

    HJ-Compiler:a compiler of a C-like language --HJC自制类C语言编译器,附带相应的代码高亮、联想IDE,并支持虚拟机运行

    类C语言--HJ语言的编译器,并附带相应的IDE和运行虚拟机 语言定义请参考文件中"语言定义.txt" 词法分析部分使用flex构建,flex程序源码见文件tokenAnalysiserSolo.l 致谢:虚拟机由完成 主界面: 虚拟机运行斐波那契...

    C语言调试常见错误C语言调试常见错误

    在C语言中,变量必须在使用前定义,否则编译器将报错。例如,以下程序将编译出错: ```c main() { a = 1; b = 2; printf("%d\n", a + b); } ``` 2. 语句后面漏写分号或不该加分号的地方加了分号。 C语言规定...

Global site tag (gtag.js) - Google Analytics