|
Just use M cross environment (MXE). It takes the pain out of the whole process:
-
Get it:
$ git clone https:
-
Install build dependencies
-
Build Qt for Windows, its dependencies, and the cross-build tools; this will take about an hour on a fast machine with decent internet access; the download is about 500MB:
$ cd mxe && make qt
-
Go to the directory of your app and add the cross-build tools to the PATH environment variable:
$ export PATH=<mxe root>/usr/bin:$PATH
-
Run the Qt Makefile generator tool then build:
$ <mxe root>/usr/i686-pc-mingw32/qt/bin/qmake && make
-
You should find the binary in the ./release directory:
$ wine release/foo.exe
Some notes:
-
Use the master branch of the MXE repository; it appears to get a lot more love from the development team.
-
The output is a 32-bit static binary, which will work well on 64-bit Windows.
|
http://stackoverflow.com/questions/10934683/how-do-i-configure-qt-for-cross-compilation-from-linux-to-windows-target
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· 三行代码完成国际化适配,妙~啊~
· .NET Core 中如何实现缓存的预热?
2016-01-05 utf8格式源代码中的字符串,默认都会当作char来处理,除非用L""符号来修饰
2016-01-05 Qt Installer Framework的学习
2016-01-05 发布Qt Quick桌面应用程序的方法
2015-01-05 MFC、WTL、WPF、wxWidgets、Qt、GTK、Cocoa、VCL 各有什么特点?
2015-01-05 C++Builder和VC的比较
2015-01-05 Apollo,Python,Delphi与Oracle之间的神话关系
2015-01-05 Delphi语言获得生命的原因和过程