简体   繁体   中英

Cross Compiling Qt5 on Linux for Windows

I recently used this guide to cross compile a program for Windows on Linux: Building Qt 5 on Linux, for Windows

However when I compile the program, the executable file that is created is broken and does not run the program. Instead there is an error and only the option to close it. It would be appreciated if anyone could please provide an answer to why it is doing that. Below I will list a couple facts. Please be specific in your answer (such as if the reason is that I have used something in the GUI not available with windows, please provide examples of what is not usable between the operating systems) I am at approximately mid entry level when it comes to using Qt so forgive me in advance if I ask for further explanation on answers. 在GUI中使用了不适用于Windows的内容,请提供操作系统之间无法使用的示例)我处于大约中等入门级别时使用Qt如果我要求对答案进一步解释,请提前原谅我。

  • Compiling with Qt Creator 2.8.1 (Based on 5.1.1)
  • Using Crunchbang 11 (Debian 7.0 based)
  • Tested by using "cd mxe && make qtbase" and subsequently "cd mxe && make qt5"
  • The error produced by executing the program (wine): Pastebin: Wine Error
  • The debugging displayed in the terminal when the program is executed: Pastebin: Debugging
  • The program does not work in typical Windows 7 environment
  • Build log: Pastebin: Build Log

It may take me a couple hours from the initial post time to follow up. Thank you in advance to everyone who puts in positive input.

I succesfully crosscompiled a program on ArchLinux for Windows.
Do you have all necessary dlls on your windows machine?
This is a list from my dir:

platforms <DIR>
 - qminimal.dll
 - qwindows.dll
sqldrivers <DIR>
 - qsqlite.dll
icudt51.dll
icuin51.dll
icuuc51.dll
libgcc_s_dw2-1.dll
libstdc++-6.dll
libwinpthread-1.dll
Qt5Core.dll
Qt5Gui.dll
Qt5Sql.dll
Qt5Widgets.dll

It's also crucial to have the right versions of all dlls. These must match the MinGW version used to crosscompile. Also the platforms directory with its two dlls is necessary. For my app I also needed SQLite support, therefore it's necessary to create another subdirectory with the needed dll.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM