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 に答える