error: must use 'class' tag to refer to type 'XX' in this scope

在写程序的时候,遇到了编译器报错 error: must use 'class' tag to refer to type 'thread' in this scope

void MainWindow::freeFreightUi(){
    freeFreight *free = new freeFreight(this);
}

需要指明是是一个类。

修改如下:

void MainWindow::freeFreightUi(){
    class freeFreight *free = new class freeFreight(this);
}
posted @ 2022-05-10 20:55  冰糖葫芦很乖  阅读(633)  评论(0编辑  收藏  举报