我有一个公共(public)功能:
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’
为什么会这样。
最佳答案
添加#include <QStringList>
到 .cpp 文件的顶部。不完整的类型意味着你的类(QStringList)之前已经使用foward declaration命名过。 , 但其内容尚未公布。
关于c++ - 声明 QStringList 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12981868/