`

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
分享到:
评论

相关推荐

    Compiler:小型C语言编译器

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

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

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

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

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

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

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

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

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

    基于MATLAB的多进制LDPC编译码误码率仿真,对比2进制,4进制,8进制以及16进制+代码仿真操作视频+word说明文档

    1.领域:matlab,多进制LDPC编译码算法 2.内容:基于MATLAB的多进制LDPC编译码误码率仿真,...如果运行报错和录像中不一样,则确认matlab是否安装了C语言编译器,然后执行mex *.c对内置的c程序进行编译,得到mexw文件

    c语言旋转位图90度

    纯c函数写的旋转位图90度程序, 提供了编程接口方便调用。 不涉及任何平台相关代码,可以在windows和linux... 其中变量定义用到了c++的规则(GNU c) 所以有些编译器可能报错, 请使用c++ 源代码格式cpp,再编译即可。

    c语言编码规范

    在C语言中不遵守编译器的规定,编译器在编译时就会报错,这个规定叫作规则。但是有一种规定,它是一种人为的、约定成俗的,即使不按照那种规定也不会出错,这种规定就叫作规范。

    如何优化C语言代码(程序员必读)

    当然,在定义变量后不要超过变量的作用范围,如果超过变量的范围赋值,C编译器并不报错,但程序运行结果却错了,而且这样的错误很难发现。 在ICCAVR中,可以在Options中设定使用printf参数,尽量使用

    你必须知道的495个C语言问题.pdf

    我在使用p2的时候报错了。 1.6 我想声明一个指针,并为它分配一些空间,但却不行。这样的代码有什么问题?char *p; *p=malloc(10); 声明风格 1.7 怎样声明和定义全局变量和函数最好? 1.8 如何在C中实现不透明(抽象...

    《你必须知道的495个C语言问题》

    我在使用p2的时候报错了。 3 1.6 我想声明一个指针,并为它分配一些空间,但却不行。这样的代码有什么问题?char *p; *p=malloc(10); 4 声明风格 4 1.7 怎样声明和定义全局变量和函数最好? 4 1.8 如何在C...

    C语言笔试大全C语言笔试大全

    可以用引用头文件的方式,也可以用extern关键字,如果用引用头文件方式来引用某个在头文件中声明的全局变理,假定你将那个变写错了,那么在编译期间会报错,如果你用extern方式引用时,假定你犯了同样的错误,那么在...

    你必须知道的495个C语言问题

    6.18 当我向一个接受指针的指针的函数传入二维数组的时候,编译器报错了。 6.19 我怎样编写接受编译时宽度未知的二维数组的函数? 6.20 我怎样在函数参数传递时混用静态和动态多维数组? 数组的大小 6.21 当...

    你必须知道的495个C语言问题(PDF)

    难道在C语言中一个结构不能包含指向自己的指针吗? . . . . 3 1.7 怎样建立和理解非常复杂的声明?例如定义一个包含N 个指向返 回指向字符的指针的函数的指针的数组? . . . . . . . . . . . . . . 3 1.8 函数只定义...

    基于 Java 的 C 语言编译器【100013298】

    详情介绍:https://www.yuque.com/sxbn/ks/100013298 采用 LL(1)文法进行分析,文法是 C 语言文法的子集,支持报错,以及错误原因。

    C语言FAQ 常见问题列表

    o 7.15 当我向一个接受指针的指针的函数传入二维数组的时候, 编译器报错了。 o 7.16 我怎样编写接受编译时宽度未知的二维数组的函数 ? o 7.17 我怎样在函数参数传递时混用静态和动态多维数组 ? o 7.18 当数组...

    Linux之源码包该如何安装?

    安装C语言编译器 gcc 下载源码包 2. 安装注意事项 源代码保存位置:/usr/local/src 软件安装位置:/usr/local 如何确定安装过程报错: 安装过程停止并出现 error、warning 或 no 的提示 3. 源码包安装过程 ① 下载...

    C语言中const和C++中的const 区别详解

    C++的const和C语言的#define都可以用来定义常量,二者是有区别的,const是有数据类型的常量,而宏常量没有,编译器可以对前者进行静态类型安全检查,对后者仅是字符替换,没有类型安全检查。 而C语言中的const与...

Global site tag (gtag.js) - Google Analytics