expected '(' to follow 'inline'

来源:互联网 发布:玄武指弹吉他教室知乎 编辑:程序博客网 时间:2024/06/05 07:06
error C2054: expected '(' to follow 'inline'

所有的.h文件中的内联函数例如:

static inline int av_cmp_q(AVRational a, AVRational b){
const int64_t tmp= a.num * (int64_t)b.den - b.num * (int64_t)a.den;

if(tmp) return (tmp>>63)|1;
else return 0;
}

都会出现下面的错误
d:\testmpeg2\sourse\rational.h(46) : error C2054: expected '(' to follow 'inline'
d:\testmpeg2\sourse\rational.h(46) : error C2085: 'av_cmp_q' : not in formal parameter list
d:\testmpeg2\sourse\rational.h(46) : error C2143: syntax error : missing ';' before '{'

大虾们给点指点,什么原因呢?


改正方法:不用改代码,直接改project->[setting]->[c/c++]->Preprocessor definitions:编辑框里输入inline=__inline即可。
原创粉丝点击