Qt TextToSpeech类出现“undefined reference to `_imp___ZN13QTextToSpeechC1EP7QObject'”错误

Qt TextToSpeech类出现“undefined reference to `_imp___ZN13QTextToSpeechC1EP7QObject'”错误
上代码
c++
#include "widget.h"
#include "ui_widget.h"
#include <QMessageBox>
#include <stdlib.h>
#include <QtTextToSpeech/QTextToSpeech>

Widget::Widget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Widget)
{
    ui->setupUi(this);
    setWindowTitle("Lottery Machine");
    QIntValidator *validator = new QIntValidator(0, 100, this);
    ui->mine->setValidator(validator);
    ui->maxe->setValidator(validator);
}

Widget::~Widget()
{
    delete ui;
}

void Widget::on_quib_clicked()
{
    close();
}

void Widget::on_genb_clicked()
{
    int mi=ui->mine->text().toInt();
    int ma=ui->maxe->text().toInt();
    int r=mi+rand()%(ma-mi+1)-49;
    char rc=r+'0';
    QMessageBox::information(this, tr("Generate"),tr("Number %1.").arg(rc+1),QMessageBox::Ok,QMessageBox::NoButton);
}

void Widget::on_gas_clicked()
{
    QTextToSpeech *speech;
    speech=new QTextToSpeech;
    int mi=ui->mine->text().toInt();
    int ma=ui->maxe->text().toInt();
    int r=mi+rand()%(ma-mi+1)-49;
    char rc=r+'0';
    const char *lc=&rc;
    speech->say(lc);
}


```

运行结果及报错内容

release/widget.o:widget.cpp:(.text+0x4b7): undefined reference to _imp___ZN13QTextToSpeechC1EP7QObject' release/widget.o:widget.cpp:(.text+0x598): undefined reference to_imp___ZN13QTextToSpeech3sayERK7QString'
collect2.exe: error: ld returned 1 exit status
Makefile.Release:67: recipe for target 'release\Lottery-Machine.exe' failed
mingw32-make[1]: Leaving directory 'C:/Users/LENOVO/Documents/build-Lottery-Machine-Desktop_Qt_5_10_1_MinGW_32bit-Release'
Makefile:36: recipe for target 'release' failed
mingw32-make[1]: *** [release\Lottery-Machine.exe] Error 1
mingw32-make: *** [release] Error 2
20:56:20: 进程"D:\programs\Qt\Tools\mingw530_32\bin\mingw32-make.exe"退出,退出代码 2 。
Error while building/deploying project Lottery-Machine (kit: Desktop Qt 5.10.1 MinGW 32bit)
When executing step "Make"

我的解答思路和尝试过的方法

尝试只引用QTextToSpeech头文件

请大佬们帮助!

.pro文件中添加 QT += texttospeech