qtNote
Summary: Author: 张亚飞 | Read Time: 1 minute read | Published: 2016-08-12
Filed under
—
Categories:
Linux
—
Tags:
Note,
下载安装 qt-enterprise-windows-x86-mingw492-5.6.0-beta.exe 添加 G:\Qt\Qt5.6.0\5.6\mingw492_32 到系统环境变量 PATH
创建 hello 文件夹
C:\Users\yafei\AppDeveloperWorkspace\QtGuiStudy\hello
建立 main.cpp 文件
#include <QApplication>
#include <QLabel>
int main(int argc, char *argv[])
{
QApplication hello(argc,argv);
QLabel *label = new QLabel;
label->setText("Hello Qt!");
label->show();
return hello.exec();
}
打开 Qt 5.6 for Desktop (MinGW 4.9.2 32 bit) [G:\Qt\Qt5.6.0\5.6\mingw492_32\bin\qtenv2.bat]
cd C:\Users\yafei\AppDeveloperWorkspace\QtGuiStudy\hello
qmake -project "QT +=widgets"
qmake
mingw32-make
Window 下使用以上命令编译完 hello.exe 后双击运行出现一系列 Qt5Widgets.dll 缺失问题
发现这些文件都在 G:\Qt\Qt5.6.0\5.6\mingw492_32\bin 目录下,于是将 G:\Qt\Qt5.6.0\5.6\mingw492_32\bin 也添加到系统环境变量 PATH 中再次双击可正常运行 * 编译完的QT程序单独运行无法启动
Comments