expected specifier-qualifier-list before sth[错误]

expected specifier-qualifier-list before sth[错误]

TIPS:gnu下遇见的一个错误,查了查出问题的原因原来是结构体,需加上Struct!

在使用GCC时经常会遇到expected specifier-qualifier-list before sth之类的错误。specifiers是指void、char、struct Foo等词汇;qualifiers是指像const和volatile一类的关键字。一个词汇再未定义之前就使用就会出项这种错误,可以通过typedef进行定义以后再使用。

错误实例:

expected specifier-qualifier-list before sth
expected specifier-qualifier-list before sth

解决方案1:

expected specifier-qualifier-list before sth
expected specifier-qualifier-list before sth

解决方案2:

expected specifier-qualifier-list before sth
expected specifier-qualifier-list before sth

One Reply to “expected specifier-qualifier-list before sth[错误]”