在QT中为linux编译一个windows程序 [英] compile a windows program for linux in QT

查看:311
本文介绍了在QT中为linux编译一个windows程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的开发人员,



i有一个用QT编写的C ++程序,现在开发的东西已经完成,它被编译为在windows内使用但是现在我我也想为它编译它。

但事情是我不知道该怎么做:-(



< b>注意:我在Windows 7上使用QT 4.7.4 32位和mingw。

Dear developers,

i have a C++ program which is written in QT, now the development stuff is done and it is compiled to be used inside windows but now i want to compile it for linux too.
but the thing is i don''t know how to do it :-(

Note: I''m using QT 4.7.4 32 bit and mingw on windows 7.

推荐答案

它看起来使用 Linux 虚拟机将是一条简单的路径,请参阅以下讨论: http:// qt -project.org/forums/viewthread/16474 [ ^ ]。
It looks using a Linux virtual machine would be the easy path, see the following discussion: http://qt-project.org/forums/viewthread/16474[^].


嗯...将你的编译器和IDE设置到Linux机器上(如果你使用的是IDE)。现在,你必须重建你的Qt适用于Linux的库,应该在他们的文档中(尽管我注意到他们的文档很糟糕一旦你构建了库,配置你的IDE(或makefile)来使用Qt库编译你的项目。



作为旁注,IDE的工作通过编译器实际上创建一个makefile(或类似的),然后将其提供给编译器,告诉它编译什么以及使用哪些选项(与链接器相同)。您必须在Linux目标操作系统上重新编译/链接Qt和您的项目。



如果您需要更具体的帮助,请发布有关的更多具体细节你被卡住了。
Well... set up your compiler to and IDE onto your Linux machine (if you use an IDE). Now, you''ll have to rebuild your Qt libraries for Linux, that should be in their documentation (although I have noticed their documentation kind of sucks). Once you have built the libraries, configure your IDE (or makefile) to compile your project using the Qt libraries.

As a sidenote, IDE''s work with the compiler by essentially making a makefile (or similar) that is then fed to the compiler to tell it what to compile and what options to use (same with linker). You''ll have to essentially recompile/link Qt and your project on your Linux target OS.

If you need more specific help, post more specific details in regards to where you''re stuck.


你可以使用linux open suse。编译c或c ++
you can use linux open suse. It so good for you to compiler c, or c ++


这篇关于在QT中为linux编译一个windows程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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