作业帮 > 综合 > 作业

出现was not declared in this scope这个错误的真正原因!

来源:学生作业帮 编辑:灵鹊做题网作业帮 分类:综合作业 时间:2024/06/13 04:59:19
出现was not declared in this scope这个错误的真正原因!
出现was not declared in this scope这个错误的真正原因是什么呢?
能不能举个简单的例子,好几次碰到这个错误,都是糊里糊涂的解决的.
比如:我的函数原型是这样的(在一个cpp文件中):
Qt3RegExp::Qt3RegExp( const Qt3RegExp& rx )
:eng( 0 )
{
priv = new Qt3RegExpPrivate;
operator=( rx );
}
而出错的地方是(另一个cpp文件):
Qt3RegExp regexp("^(X-)?(CP|IBM)(-| (0-9)+");
出错的提示是:
'Qt3RegExp' was not declared in this scope
如何改呢?
出现was not declared in this scope这个错误的真正原因!
就是标识符没有声明.后面那个in this scope是画蛇添足的话.