45down voteaccepted

Just use M cross environment (MXE). It takes the pain out of the whole process:

  • Get it:

    $ git clone https://github.com/mxe/mxe.git
  • 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

Qt from Linux to Windows target的更多相关文章

  1. QT安装以及使用(QT支持linux和windows,也支持C/C++代码的编译运行,比vs简洁多)

    Windows: 0. QT Versionqt-win-opensource-4.7.4-mingwqt-creator-win-opensource-2.4.1 1. 系统Windows 7 &a ...

  2. 在Linux和Windows平台上操作MemoryMappedFile(简称MMF)

    操作系统很早就开始使用内存映射文件(Memory Mapped File)来作为进程间的共享存储区,这是一种非常高效的进程通讯手段..NET 4.0新增加了一个System.IO. MemoryMap ...

  3. 【转】linux和windows下安装python集成开发环境及其python包

    本系列分为两篇: 1.[转]windows和linux中搭建python集成开发环境IDE 2.[转]linux和windows下安装python集成开发环境及其python包 3.windows和l ...

  4. Qt在Linux环境下应用程序字体模糊的解决方法(先改成使用默认字体,然后使用qtconfig配置)

    这两天一直在用Qt实现一个跨平台的软件.软件之前在Windows上编写的,后来放到里Ubuntu 10.10下编译.程序运行时遇到一个很棘手的问题,界面文本非常模糊.后来在网上查阅了好几天的资料,经历 ...

  5. LCOW —— 单一Docker引擎下可同时运行Linux和Windows容器啦!

    https://blog.csdn.net/m2l0zgssvc7r69efdtj/article/details/79251059 就在上周,Docker官方的master分支上新增了LCOW(Li ...

  6. Linux与Windows 10用grub引导教程

    前言 去年暑假的时候,写了一篇如何装 Linux 和 Windows 10 双系统的文章发在了简书上,我写这篇文章的原因是当初装双系统确实是折腾了许久,网上也找不到一篇详尽的教程.由于去年对于写教程还 ...

  7. 个人项目-WC(C/C++ 兼容Linux和Windows)

    一.Github地址 https://github.com/S-TRAVELER/WC 实现的功能: 支持 -c 支持 -w 支持 -l 支持 -s 支持 -a 图形界面 多参数(文件名或通配符表达式 ...

  8. 【热文】 为什么很多硅谷工程师偏爱 OS X,而不是 Linux 或 Windows?

    校对:伯乐在线 - 黄利民 链接: 1. Why do most of the developers in Silicon Valley prefer OS X over Linux or Windo ...

  9. 分享一实战性开源MVC框架<Linux、Windows跨平台开发so easy>

    一.引子   开源地址 https://github.com/564064202/Moon.Mvc 欢迎加入开发 .NET Core微软还在发力,但作为商用还有一段距离,很多开发库尚不能用于.NET ...

随机推荐

  1. Hadoop_10_12虚拟机01_虚拟机NAT方式联网【自己的亲测笔记】

      NAT方式 1.查看网络信息--ifconfig(同windows中的ipconfig相同) 主要关注的是第三行内容,分别是Ip地址.广播地址.子网掩码 2.安装完系统后需要配置三个地方--IP地 ...

  2. BZOJ1707 : [Usaco2007 Nov]tanning分配防晒霜

    S向每头奶牛连边,容量1 每个防晒霜向T连边,容量cover 每头奶牛向SPF在自己范围内的防晒霜连边,容量inf 用线段树优化建图跑最大流即可. #include<cstdio> con ...

  3. HTML6 展望

    HTML5 概述 HTML5 是 HTML 语言最受欢迎的版本之一,它支持音频和视频.离线存储.移动端.和标签属性等等.还提供了<article>, <section>, &l ...

  4. ios 开发中出现的 pointer being freed was not allocated *** set a breakpoint in malloc_error_break to debug

    主要原因是某部分内存释放的太频繁,解决方法是检查函数的中[xxx release]; 将其注释掉 就行了

  5. Linux_屏蔽360、scanv、QQ管家等IP扫描

    vi banip.sh #!/bin/bash echo "banip" iptables -A INPUT -s 221.204.203.0/24 -j DROP iptable ...

  6. win7 无法复制粘贴

     win7 无法复制粘贴解决办法 在开始-运行里输入以下命令 regsvr32 shdocvw.dll ,确定,接着出现一个消息框,确定 regsvr32 oleaut32.dll,确定,接着出现一个 ...

  7. 在openGL中绘制图形

    点的绘制.: glVertex*():星号表示函数要有后缀 该函数 需要放在glBegin函数和glEnd函数之间,glBegin函数的向量指定绘制图元的类型,而glEnd函数没有参数,例如: glB ...

  8. hdu Can you solve this equation?

    本题是一道二分的题,核心就是mi的大小,即精度的取值.因为原函数是一个单调递增的函数,所以可以确定y的取值范围,并且在范围内的每一个y的值,一定至少存在一个x与其对应.刚开始我将取二分这个环节用一个函 ...

  9. java实现吸血鬼数字

    public class Vempire { public static void main(String[] arg) { String[] ar_str1, ar_str2; ; int from ...

  10. JSP简单访问数据库

    Java代码 public class DBHelper { private String driverName; private String url; private String user; p ...