头文件中有这句: QMainComThread(QString name, const PortSettings *settings);
cpp文件中
QMainComThread::QMainComThread(QString name, const PortSettings *settings)
{
comsettings = new PortSettings();
*comsettings = *settings;
comname = name;
comport = NULL;
} 但是提示错误 ISO C++ forbids declaration of 'PortSettings' with no type
expected ',' or '...' before '*' token
return type specification for constructor invalid 求解。。。
PortSettings类的头文件没有包含?在头文件类之前加上 class PortSettings;试试