invalid use of incomplete type ‘class Ui::xxx‘

MainWindow 引用自定义窗口报错:invalid use of incomplete type 'class Ui::xxx'

mainwindow.cpp

#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "form.h"

form.cpp 

#include "form.h"
#include "ui_form.h"

把 #include "ui_form.h" 从 form.cpp 移到 form.h 中!

form.h

#include "ui_form.h"

你可能感兴趣的:(Qt,qt)