为什么MinGW的stdio.h文件导致语法错误?

时间:2019-05-22 14:43:35

标签: c windows gcc mingw

我在Eclipse中有一个C项目,并且在Windows 7上使用MinGW进行编译。我在stdio.h中收到了似乎是源于我项目外部的语法错误:

nextProps

编译命令为

c:\mingw\include\stdio.h:345:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__mingw__snprintf'
 extern int __mingw_stdio_redirect__(snprintf)(char*, size_t, const char*, ...);
            ^~~~~~~~~~~~~~~~~~~~~~~~
c:\mingw\include\stdio.h:349:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__mingw__vsnprintf'
 extern int __mingw_stdio_redirect__(vsnprintf)(char*, size_t, const char*, __VALIST);
            ^~~~~~~~~~~~~~~~~~~~~~~~

我想了解是什么导致了这些错误,以便在不编辑stdio.h的情况下进行编译。

1 个答案:

答案 0 :(得分:0)

问题是由stdio.h包含在错误的位置引起的。在文件开头添加该文件即可解决此问题。

相关问题