在Linux上使用Qt为Windows创建可执行文件 [英] Creating executable for Windows using Qt on Linux

查看:924
本文介绍了在Linux上使用Qt为Windows创建可执行文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在Eclipse上使用相同的Qt代码在Linux和Windows上为Linux创建可执行文件?还是有必要在我的Linux机器上安装Qt Creator?

Is it possible to create an executable on Linux for both Linux and Windows using the same Qt code with Eclipse? Or is it necessary to install Qt Creator on my Linux machine?

推荐答案

如果要在Linux上构建Windows二进制文件,则需要交叉编译.这意味着您需要安装Windows交叉编译器,以及要与使用交叉编译器构建的库链接的库.对于基本的Qt程序,这意味着您至少需要交叉编译的Qt.

If you want to build a windows binary on linux you need to cross-compile. This means you need to have a windows cross-compiler installed plus the libraries you are linking with built with the cross compiler. For a basic Qt program this means you need at least a cross-compiled Qt.

交叉编译与Eclipse或Qt Creator无关.我不认为两者都支持开箱即用的交叉编译功能,但我想您可以让他们这样做.

Cross-compiling has nothing to do with Eclipse or Qt Creator. I don't think both support cross compiling out of the box but I guess you could make them to do so.

这篇关于在Linux上使用Qt为Windows创建可执行文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆