写好的QT界面程序 在QTcreator下编译都可以 没有错误
qmake -project ,qmake都可以生成.pro和Makefile
但是在make时出现错误,没有QMainWindow文件 ,求大神解决
Qt5 交叉编译
------解决方案--------------------
在pro文件上加上greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
------解决方案--------------------
官方文档上说明了,如果是自己qmake的话,得加上qt += widgets:
You could also use qmake's -project option to generate the .pro file. Although, in that case, you have to remember to add the line QT += widgets to the generated file in order to link against the Qt Widgets Module.
------解决方案--------------------
+1