-1

I have built a Qt project on Ubuntu, but when I am running the executable file of the project on windows it prompts with the error:

"This app can't run on your PC".

Why is this happening? what can I do to make my app work?

Brian Tompsett - 汤莱恩
  • 5,438
  • 68
  • 55
  • 126
  • Possible duplicate of [Why does a linux compiled program not work on Windows](http://stackoverflow.com/questions/32117572/why-does-a-linux-compiled-program-not-work-on-windows) – Jonny Henly Sep 01 '16 at 19:35
  • 1
    Binary executable format on Windows (PE) differs from Ubuntu (ELF). To run your application on Windows you should recompile it for Windows. – Nikita Sep 01 '16 at 20:37
  • how to recompile for windows? – Harry Potter Sep 01 '16 at 22:23
  • The easy way is to install a compiler and the the Qt SDK on a Windows machine and use it to compile your project. – Matteo Italia Sep 02 '16 at 05:35
  • You can actually also build EXEs on Linux for Windows though the complexity the Qt framework adds to all that is too big I think. You can get free virtual machines with Windows 7 and up provided by Microsoft at https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/. These are meant for testing web browser compatibility for web developers against IE and Edge but you can easily use them for compiling stuff and testing how it runs. Note that the machines have limited activation time though extending the limit through re-arming is possible. – rbaleksandar Sep 02 '16 at 21:02

1 Answers1

0

check out this link for building qt app on windows https://wiki.qt.io/Build_Standalone_Qt_Application_for_Windows

HazemGomaa
  • 1,518
  • 2
  • 13
  • 21