参考文档:
https://blog.csdn.net/weixin_39510813/article/details/79680772
https://zhidao.baidu.com/question/1307879568875448739.html
https://www.bbsmax.com/A/1O5E2vOyd7/
安装 msys2
安装 c/c++ 开发环境
运行安装目录下的 mingw64.exe,安装 c/c++ 开发环境(toolchain 使用的是 gcc):
pacman -S mingw-w64-x86_64-toolchain
或者:
pacman -S mingw-w64-x86_64-clang
注意:clang 是另一种 c/c++ 编译器,但推荐使用gcc
安装 qt、qt creator
pacman -S mingw-w64-x86_64-qt5 mingw-w64-x86_64-qt-creator
启动 qt creator
qtcreator
编写 helloworld 案例
请参考文档:https://blog.csdn.net/weixin_39510813/article/details/79680772
release 版本的生成方式
请参考文档:https://zhidao.baidu.com/question/1307879568875448739.html
编译 helloworld 案例
关于qt 的静态编译与动态编译,请参考文档:https://www.bbsmax.com/A/1O5E2vOyd7/
在 mingw64.exe 的终端中执行如下命令:
windeployqt /d/tmp/build-helloworld-Desktop_Qt_MinGW_w64_64bit_MSYS2-Release/release/helloworld.exe
说明:windeployqt 后面的参数为 qt 可执行文件的路径