Extra qualification errors are common with gcc4. This means a class is
redundantly mentioned with a class function. Just remove the part before :: on the mentioned line"
Extra qualification error是使用版本4以上的GCC/G++编译C++程序时经常出现的错误。
这是语句中多引用了类的名称--把函数前面::的类名称去掉即可
如:
std::string Socket::connectionName();
connectionName是类Socket的成员函数,而Socket是std 中type为string的子类.
这里不用重复引用Socket,可直接写成
std::string connectionName();
GCC 4+ Extraqualification 错误解析
本文解析了使用GCC 4+编译C++程序时常见的Extraqualification错误,这种错误通常是因为在类成员函数声明或定义时冗余地指定了类名。文章通过一个具体的例子解释了解决方案——即移除不必要的类前缀。
3599





