我有一个公共函数:
void determineAction(QStringList tempL); // in header file
void CompArch::determineAction(QStringList tempL)
{
}
//in cpp file我得到了错误:
CompArch.cpp:127:6: error: ‘tempL’ has incomplete type
/usr/include/qt4/QtCore/qstring.h:77:7: error: forward declaration of ‘struct QStringList’你知道为什么会这样吗?
发布于 2012-10-20 04:20:39
在.cpp文件的顶部添加#include <QStringList>。类型不完整意味着您的类(QStringList)以前已经使用foward declaration命名过,但其内容尚未声明。
发布于 2012-10-20 04:23:08
类型不完整意味着编译器已将QStringList视为类,但未看到QStringList类头的主体。看起来您必须包含一个包含QStringList类标头主体的标头。
https://stackoverflow.com/questions/12981868
复制相似问题