Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Creating a single-file 64-bit executable with Qt



  • I've created a program that I distribute for Windows as a single exe: to do this I've created a few years ago a static version of Qt. At those times I used Qt 5.7.0, with Mingw53_32, and everything worked well, so I remained loyal to Qt 5.7.0 and Mingw53_32.

    Now some users ask me to get a 64 bit (Windows) version of my program. So I've to create a new version of static Qt libraries. I would prefer to stick with Qt 5.7, but could also change version, in case of need.
    Similarly I can use either MinGW or MSVC (I have 2010 and 2013), whichever works.

    I've searched a lot on the Internet, but found nothing useful for me: all I found referred to win32. But I cannot think that nobody has crated yet a single-file 64 bit Win executable!
    Can anyone address me to some source of information for this?

    Thanks to anyone.


  • Moderators

    @mchome You can build Qt with the mingw 64 bit compiler. And you can tell Qt to build static. In the past it has been difficult to get a 64-bit mingw build of Qt for me. So my advice there is to make sure you use the exact version that Qt uses to build whatever your target version of Qt is. It will come with some headaches (what in Windows doesn't though) but it should be buildable.

    Lastly, be aware of licensing constraints with doing that. You need a commercial license of Qt in order to distribute statically linked binaries. You can't use the open source version. Of course that is true of your 32-bit one as well, so you probably already knew that. Just warning you in case you didn't know.


  • Moderators

    @ambershark said in Creating a single-file 64-bit executable with Qt:

    You can't use the open source version

    Not unless the application is licensed under LGPL/GPL as well, that is.


Log in to reply