3

I have a public function:

void determineAction(QStringList tempL); // in header file

void CompArch::determineAction(QStringList tempL)
{


}

//in cpp file

I get the error:

CompArch.cpp:127:6: error: ‘tempL’ has incomplete type
/usr/include/qt4/QtCore/qstring.h:77:7: error: forward declaration of ‘struct QStringList’

any ideas why this might be.

4

2 回答 2

10

add #include <QStringList> to the top of your .cpp file. Incomplete type means that your class (QStringList) has already been named before, using foward declaration, but the content of it has not been declared.

于 2012-10-19T20:20:39.233 回答
1

不完整类型意味着编译器已经将 QStringList 视为类,但没有看到 QStringList 类头的主体。看起来您必须包含一个包含 QStringList 的类标题主体的标题。

于 2012-10-19T20:23:08.213 回答